//extension public static void SeedAccounts(this FinancialAppContext context) { context.Add(new Account { Amount = 500, ConversionRate = 0.25, Currency = "USD", Name = "Account 1" }); context.Add(new Account { Amount = 560, ConversionRate = 0.25, Currency = "USD", Name = "Account 2" }); context.Add(new Account { Amount = 450, ConversionRate = 1, Currency = "HNL", Name = "Account 3" }); context.SaveChanges(); }
public static FinancialAppContext GetInMemoryContext() { var connection = new SqliteConnection("DataSource=:memory:"); connection.Open(); var dbContextOptions = new DbContextOptionsBuilder <FinancialAppContext>() .UseSqlite(connection) .Options; var context = new FinancialAppContext(dbContextOptions); context.Database.EnsureCreated(); return(context); }
protected BaseRepository(FinancialAppContext context) { Context = context; }
public AccountRepository(FinancialAppContext financialAppContext) { _financialAppContext = financialAppContext; }
public TransactionRepository(FinancialAppContext context) : base(context) { }
public AccountRepository(FinancialAppContext context) : base(context) { }
public TransactionRepository(FinancialAppContext financialAppContext) { _financialAppContext = financialAppContext; }
public TransactionRepository(FinancialAppContext context) { this._context = context; }
public AccountRepository(FinancialAppContext context) { this._context = context; }