I am getting DbContext has been disposed error
when I try to get data from database using below code that have mention.
How to solved this issue ?
public class ExampleService<T> where T : Example
{
protected readonly IRepository<T> _exampleRepository;
public ExampleService()
{
_exampleRepository= EngineContext.Current.Resolve<IRepository<T>>();
}
public IList<T> GetService()
{
var query = _exampleRepository.Table;
return query.ToList();
}
}