/// <summary> /// Initializes a new instance of the EmployeeRepository class. /// </summary> /// <param name="context">Context to retrieve data from</param> public EmployeeRepository(IEmployeeContext context) { if (context == null) { throw new ArgumentNullException("context"); } this.objectSet = context.Employees; }
/// <summary> /// 启动时启动输入窗体 /// </summary> /// <param name="e">startup 事件的参数</param> protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); if (this.useFakes) { this.context = Generation.BuildFakeSession(); } else { //注意: 如果 .\SQLEXPRESS 中没有 Microsoft SQL Server Express 实例, // 您将需要更新 App.config 中的“EmployeeEntities”连接字符串 this.context = new EmployeeEntities(); } IDepartmentRepository departmentRepository = new DepartmentRepository(this.context); IEmployeeRepository employeeRepository = new EmployeeRepository(this.context); IUnitOfWork unit = new UnitOfWork(this.context); MainViewModel main = new MainViewModel(unit, departmentRepository, employeeRepository); MainView window = new View.MainView { DataContext = main }; window.Show(); }
/// <summary> /// Lauches the entry form on startup /// </summary> /// <param name="e">Arguments of the startup event</param> protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); if (this.useFakes) { this.context = Generation.BuildFakeSession(); } else { //NOTE: If there is not a Microsoft SQL Server Express instance available at .\SQLEXPRESS // you will need to update the "EmployeeEntities" connection string in App.config this.context = new EmployeeEntities(); } IDepartmentRepository departmentRepository = new DepartmentRepository(this.context); IEmployeeRepository employeeRepository = new EmployeeRepository(this.context); IUnitOfWork unit = new UnitOfWork(this.context); MainViewModel main = new MainViewModel(unit, departmentRepository, employeeRepository); MainView window = new View.MainView { DataContext = main }; window.Show(); }
public CompensationRepository(ILogger <ICompensationRepository> logger, IEmployeeContext compensationContext) { _compensationContext = compensationContext; _logger = logger; }
public TaskRepository(IEmployeeContext employeeContext) { _employeeContext = employeeContext; }
public PositionRepository(IEmployeeContext context, IMapper mapper) { this._context = context as EmployeeContext; this._mapper = mapper; }
public void CreateContext() { IEmployeeContext context = InitialTest.SeedDatabaseFourEmployees(); _iRepo = repo; }
public EmployeeService(IEmployeeContext cntx, IMapper mapper) { _cntx = cntx ?? throw new ArgumentNullException(nameof(cntx)); _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
public PersonRepository(IEmployeeContext context) : base(context) { }
//public Repository() //{ // this.context = new EmployeeContext(); //} public Repository(IEmployeeContext context) { this.context = context; }
public EmployeeLogic(IEmployeeContext Context) { this.EmployeeContext = Context; }
public IndexModel(IEmployeeContext employeeContext) { _employeeContext = employeeContext; }
public DepartmentController(IEmployeeContext context) { this.db = context; }
public DepartmentController() { this.db = new EmployeeContext(); }
public EmployeeLogic(IEmployeeContext context) { Repository = new EmployeeRepository(context); }
public EmployeeRepository(IEmployeeContext employeeContext) { this.context = employeeContext; }
public EmployeeRepository(IEmployeeContext context) { this.context = context; }
public EmployeeRepository(IEmployeeContext context) { _context = context; }
public EmployeeService(IEmployeeContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); }
public TeamRespository(IEmployeeContext context) { this.context = context; }
public EmployeesController(IEmployeeContext context) { this.context = context; }
public DepartmentRepository(IEmployeeContext context) : base(context) { }
/// <summary> /// this is for testing purpose, we can remove this when we implement IOC framework like Unit framework /// </summary> internal EmployeeRepository(IEmployeeContext context) { _context = context; }
public EmployeesController() { this.context = new EmployeeContext(); }
public EmployeeService(IEmployeeContext context) { this.context = context; }
public IocIndexModel(IEmployeeContext employeeContext, IHttpContextAccessor httpContextAccessor) { _employeeContext = employeeContext; //必须引用Microsoft.Extensions.DependencyInjection,这种方法一般不推荐 _reflectionDemo = httpContextAccessor.HttpContext.RequestServices.GetService <IReflectionDemo>(); }
public EmployeeRepository() { Empctx = new SQLConnect(); }
public PositionRepository(IEmployeeContext context) { this._context = context as EmployeeContext; this._mapper = (IMapper)IoCHelper.GetResolveService(typeof(IMapper)); }
public EmployeesController(IEmployeeContext employeeContext) { _employeeContext = employeeContext; }
public EmployeeReadOnlyRepository(IEmployeeContext context) : base(context) { }
public PaycheckHandler(IPaycheckService paycheckService, IEmployeeContext employeeContext, IEmployeeValidator employeeValidator) { _paycheckService = paycheckService; _employeeContext = employeeContext; _employeeValidator = employeeValidator; }
/// <summary> /// Constructor /// </summary> /// <param name="employeeContext">The injected employee context</param> public EmployeeRepository(IEmployeeContext employeeContext) { _employeeContext = employeeContext ?? throw new ArgumentNullException(nameof(employeeContext)); }
public EmployeeViewModel(IEmployeeContext context) { this.context = context; Employees = new ObservableCollection <Employee>(); }
public EmployeeAPIController(IEmployeeContext employeeContext) { this._employeeContext = employeeContext; }
public EmployeeController(IEmployeeContext context, IPaycheckHandler handler) { _context = context; _handler = handler; }