protected virtual void Dispose(bool disposing) { if (context != null) { if (disposing) { context.Dispose(); context = null; } } }
public Repositories() { this.context = new IBankContext(); Customers = new DataRepository <Customer>(context); AccessCards = new DataRepository <AccessCard>(context); AccessCodes = new DataRepository <AccessCode>(context); OwnSSISPayments = new DataRepository <OwnSSISPayment>(context); OwnTransferPayments = new DataRepository <OwnTransferPayment>(context); OwnArbitraryPayments = new DataRepository <OwnArbitraryPayment>(context); OwnMobilePayments = new DataRepository <OwnMobilePayment>(context); SSISPayments = new DataRepository <SSISPayment>(context); SSISGroups = new DataRepository <SSISGroup>(context); MobileAutoPayments = new DataRepository <MobileAutoPay>(context); }
public DataRepository(IBankContext context) { this.context = context; this.dbSet = context.Set <T>(); }