Ejemplo n.º 1
0
        public static void ConfigureSqlLiteDatabase(this IServiceCollection services, String connectionString)
        {
            // Configures the contest
            var connection = new SqliteConnection(connectionString);

            connection.Open();

            services.AddDbContext <LoanCalculatorContext>(options =>
                                                          options.UseSqlite(connection)
                                                          );

            // Make sure the database exists
            var builder = new DbContextOptionsBuilder <LoanCalculatorContext>();

            builder.UseSqlite(connection);

            using (var context = new LoanCalculatorContext(builder.Options))
            {
                context.Database.EnsureCreated();
            }
        }
 public LoanRateRepository(LoanCalculatorContext context)
 {
     _context = context;
 }
 public LoanApplicationResultRepository(LoanCalculatorContext context)
 {
     _context = context;
 }