/// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen; WindowsAppInitializer.InitializeAsync( WindowsCollectors.Metadata | WindowsCollectors.Session); InitializeComponent(); Suspending += OnSuspending; //var path = ApplicationData.Current.LocalFolder; try { LocalizationHelper.SetLocale(LocalizationHelper.GetCurrentLocale()); using (var db = new FamilyBudgetContext()) { db.Database.Migrate(); FamilyBudgetInitializer.Initialize(); new CurrencyServiceWrapper().RefreshCurrencies(); } } catch (Exception ex) { } }
private void Dispose(bool disposing) { if (disposing) { if (_dbContext != null) { _dbContext.Dispose(); _dbContext = null; } } }
public Repository(Microsoft.Data.Entity.DbContext dataContext) { DbContext = (FamilyBudgetContext)dataContext; DbSet = dataContext.Set <T>(); }
public UnitOfWork() { _dbContext = new FamilyBudgetContext(); _disposed = false; }
public FamilyBudgetRepository(FamilyBudgetContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); }