public EmployeeDataService(EmployeesDatabaseContext context)
 {
     _logger    = LogManager.GetCurrentClassLogger();
     _dbContext = context;
     _dbContext.Database.EnsureCreated();
     _dbContext.Employees.Load();
     _dbContext.Employees.OrderBy(emp => emp.Name);
     DataSet = _dbContext.Employees.Local.ToObservableCollection();
 }
        public static IServiceCollection ConfigureDependencies(this IServiceCollection collection, IConfiguration configuration)
        {
            var connectionString = configuration["ConnecstionString"];
            var dbContext        = new EmployeesDatabaseContext(connectionString);

            collection.AddTransient <IEmployeesRepository>(x => new EmployeesRepository(dbContext));
            collection.AddSingleton <IEmployeesService, EmployeesService>();
            return(collection);
        }
 public ManagerController(EmployeesDatabaseContext context)
 {
     this.context = context;
 }
Example #4
0
 public DbInitializerService(EmployeesDatabaseContext context)
 {
     this.context = context;
 }
 public EmployeesRepository(EmployeesDatabaseContext databaseContext) => _dbContext = databaseContext;
 public EmployeeController(EmployeesDatabaseContext context, IMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }
 public EmployeesController(EmployeesDatabaseContext employeesDatabaseContext)
 {
     _employeesDatabaseContext = employeesDatabaseContext;
 }