Hi,
Im having "The operation cannot be completed because the DbContext has been disposed" error. Here is my code
//ctor
public test(IStoreService storeService,
IProductService productService)
{
this._storeService = storeService;
this._productService = productService;
}
//methods
public void Generate()
{
var stores = _storeService.GetAllStores();
foreach (var str in stores)
{
var products = _productService.SearchProducts(storeId: str.Id); //error throws at here
}
}
Anyone knows why is _storeService is working but _productService has error?