public NorthwindDtoRepository() { // for the server-model "real" Northwind DbContext _contextProvider = new EFContextProvider <Northwind.Models.NorthwindContext>(); _entitySaveGuard = new NorthwindEntitySaveGuard(); _contextProvider.BeforeSaveEntityDelegate += _entitySaveGuard.BeforeSaveEntity; }
private void PrepareSaveGuard() { if (_entitySaveGuard == null) { _entitySaveGuard = new NorthwindEntitySaveGuard { UserSessionId = UserSessionId }; _contextProvider.BeforeSaveEntitiesDelegate += BeforeSaveEntities; _contextProvider.AfterSaveEntitiesDelegate += AfterSaveEntities; } }
public NorthwindRepository() { _contextProvider = new EFContextProvider <NorthwindContext>(); _entitySaveGuard = new NorthwindEntitySaveGuard(); _contextProvider.BeforeSaveEntityDelegate += _entitySaveGuard.BeforeSaveEntity; }