コード例 #1
0
        /// <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)
            {
            }
        }
コード例 #2
0
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_dbContext != null)
         {
             _dbContext.Dispose();
             _dbContext = null;
         }
     }
 }
コード例 #3
0
 public Repository(Microsoft.Data.Entity.DbContext dataContext)
 {
     DbContext = (FamilyBudgetContext)dataContext;
     DbSet     = dataContext.Set <T>();
 }
コード例 #4
0
 public UnitOfWork()
 {
     _dbContext = new FamilyBudgetContext();
     _disposed  = false;
 }
コード例 #5
0
 public FamilyBudgetRepository(FamilyBudgetContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }