Example #1
0
        private async Task Seed(ManagementFinanceAppDbContext context)
        {
            var entityCategoryIncomes = new []
            {
                new Entities.CategoryIncome {
                    Id = 1, Description = "x1"
                },
                new Entities.CategoryIncome {
                    Id = 2, Description = "x2"
                },
                new Entities.CategoryIncome {
                    Id = 3, Description = "x3"
                },
                new Entities.CategoryIncome {
                    Id = 4, Description = "x4"
                },
                new Entities.CategoryIncome {
                    Id = 5, Description = "x5"
                },
                new Entities.CategoryIncome {
                    Id = 6, Description = "x6"
                }
            };

            await context.CategoryIncomes.AddRangeAsync(entityCategoryIncomes);

            await context.SaveChangesAsync();
        }
        private async Task Seed(ManagementFinanceAppDbContext context)
        {
            var entityExpenses = new []
            {
                new Entities.Expense {
                    Id = 1, Comment = "x1"
                },
                new Entities.Expense {
                    Id = 2, Comment = "x2"
                },
                new Entities.Expense {
                    Id = 3, Comment = "x3"
                },
                new Entities.Expense {
                    Id = 4, Comment = "x4"
                },
                new Entities.Expense {
                    Id = 5, Comment = "x5"
                },
                new Entities.Expense {
                    Id = 6, Comment = "x6"
                }
            };

            await context.Expenses.AddRangeAsync(entityExpenses);

            await context.SaveChangesAsync();
        }
Example #3
0
        private async Task InitDatabaseInMemoryTest()
        {
            // https://docs.microsoft.com/en-us/ef/core/miscellaneous/testing/in-memory
            options = new DbContextOptionsBuilder <ManagementFinanceAppDbContext>()
                      .UseInMemoryDatabase(databaseName: "ManagamentFinanceAppTest")
                      .Options;
            context = new ManagementFinanceAppDbContext(options);
            await Seed(context);

            queryDBInMemory = new Repository.Repository <Entities.CategoryIncome>(context);
        }
 public RestrictionRepository(ManagementFinanceAppDbContext context) : base(context)
 {
 }
Example #5
0
 public FrequencyRepository(ManagementFinanceAppDbContext context) : base(context)
 {
 }
Example #6
0
 public IncomeRepository(ManagementFinanceAppDbContext context) : base(context)
 {
 }
 public SavingRepository(ManagementFinanceAppDbContext context) : base(context)
 {
 }
 public TransferHistoryRepository(ManagementFinanceAppDbContext context) : base(context)
 {
 }
 public StandingOrderHistoryRepository(ManagementFinanceAppDbContext context) : base(context)
 {
 }
 public CategoryGroupRepository(ManagementFinanceAppDbContext context) : base(context)
 {
 }
Example #11
0
 public InvestmentScheduleRepository(ManagementFinanceAppDbContext context) : base(context)
 {
 }
Example #12
0
 public Repository(ManagementFinanceAppDbContext context)
 {
     Context = context;
 }
 public ExpenseRepository(ManagementFinanceAppDbContext context) : base(context)
 {
 }