Ejemplo n.º 1
0
        public static void Initialise(XpenseDbContext context)
        {
            context.Database.EnsureDeleted();

            context.Database.EnsureCreated();

            var organisations = GetOrganisations();
            var employees     = GetEmployees(organisations);

            if (!context.Organisations.Any())
            {
                context.Organisations.AddRange(organisations);
            }

            if (!context.Employees.Any())
            {
                context.Employees.AddRange(employees);
            }

            if (context.ChangeTracker.HasChanges())
            {
                context.SaveChanges();
            }
        }
Ejemplo n.º 2
0
 public BaseRepository(XpenseDbContext context)
 {
     _context = context;
 }
Ejemplo n.º 3
0
 public OrganisationRepository(XpenseDbContext context) : base(context)
 {
 }
Ejemplo n.º 4
0
 public EmployeeRepository(XpenseDbContext context) : base(context)
 {
 }