Exemple #1
0
        public static void SeedDatabase(AuditLogDbContext context)
        {
            var customers = new List <Customer>
            {
                new Customer
                {
                    FirstName = "Test1",
                    LastName  = "Test1",
                    Salary    = 10000
                },
                new Customer
                {
                    FirstName = "Test2",
                    LastName  = "Test2",
                    Salary    = 20000
                }
            };

            context.Database.Migrate();

            //return customers;
            if (!context.Customers.Any())
            {
                context.Customers.AddRange(customers);
                context.SaveChanges();
            }
        }
Exemple #2
0
 public AuditLogRepository(AuditLogDbContext auditLogDbContext)
 {
     _auditLogDbContext = auditLogDbContext;
 }
Exemple #3
0
 public CustomerRepository(AuditLogDbContext auditLogDbContext, IAuditLogRepository auditLogRepository)
 {
     _auditLogDbContext  = auditLogDbContext;
     _auditLogRepository = auditLogRepository;
 }