public static EmployeeControllerHelper Create(IPrincipal principal, IEmployeeDbContext context = null) { if (principal.IsInRole("Admin")) { return(new AdminHelper()); } if (principal.IsInRole("Client")) { if (context == null) { throw new ArgumentNullException(nameof(context), "For the \"Client\" role argument must be not null"); } return(new ClientHelper(context)); } #if !DEBUG throw new InvalidOperationException("Incorrect user role for this operation"); #endif if (context == null) { throw new ArgumentNullException(nameof(context), "For the \"Client\" role argument must be not null"); } return(new ClientHelper(context)); }
public ProjectController(EmployeeDbContext context) { this.context = context; }
public EmployeeController(EmployeeDbContext context) { this.context = context; }
public EmployeeRepository(IEmployeeDbContext context) { _context = context; }
//for tests only public EmployeeController(IEmployeeDbContext context, EmployeeControllerHelper helper) { db = context ?? new EmployeeDbContext(); _helper = helper; }
//for tests only public EmployeeController(IEmployeeDbContext context) { db = context ?? new EmployeeDbContext(); }
public ClientHelper(IEmployeeDbContext context) { _context = context; }
/// <summary> /// EmployeeRepository /// </summary> /// <param name="employeedbContext">employeedbContext</param> public EmployeeRepository(IEmployeeDbContext <T> employeedbContext) { this.employeedbContext = employeedbContext; }
public EmployeeRepository(IEmployeeDbContext context, IEmployeeAdapter employeeAdapter) { Context = context; EmployeeAdapter = employeeAdapter; }