This question is locked. New answers and comments are not allowed.
Hello all, I would like to know if the dispose method below is correct.
I'm using Simple Injector, and this is my container configuration:
_container.RegisterSingle<IGroupRepository>(
new
GroupRepository(
new
OpenAccessContext(MyContextConfig.ConnectionStringName, MyContextConfig.GetBackendConfiguration(),
new
GroupDataSource())));
public
MyRepository(OpenAccessContext context)
{
_context = context;
public
IQueryable<Group> ListGroups()
{
return
_context.GetAll<Group>();
}
public
void
Dispose()
{
_context.DisposeDatabase();
_context.Dispose();
}
}