public DepartmentController(IOptions <AppSettings> appSettings, IDepartmentContext departmentContext, IAadCollector aadCollector, IGroupContext groupContext, ILogger <DepartmentController> logger)
 {
     _appSettings       = appSettings.Value;
     _departmentContext = departmentContext;
     _aadCollector      = aadCollector;
     _groupContext      = groupContext;
     _logger            = logger;
 }
    public async Task InvokeAsync(HttpContext context, IDepartmentContext departmentContext)
    {
        await TryGetDepartmentFromBody(context, departmentContext);

        // TryGetFromQuery
        // TryGetFromRoute
        await _next(context);
    }
Beispiel #3
0
 public UserSerivice(IOptions <AppSettings> appSettings, IGroupContext groupContext, IDepartmentContext departmentContext, IWebhookService webhookService, ILogTable logTable, IAadCollector aadCollector)
 {
     _appSettings       = appSettings.Value;
     _departmentContext = departmentContext;
     _groupContext      = groupContext;
     _webhookService    = webhookService;
     _logTable          = logTable;
     _aadCollector      = aadCollector;
 }
        public void DepartmentRepositoryConstructorFalseInput()
        {
            EmptyLists();
            IDepartmentContext testContext = null;

            Exception ex = Assert.Throws <NullReferenceException>(() => departmentRepository = new DepartmentRepository(testContext));

            Assert.Equal("De afdelingContext is leeg.", ex.Message);
        }
 public DepartmentRepo(Context contextType)
 {
     if (contextType == Context.Mssql)
     {
         iContext = new DepartmentSqlContext();
     }
     else if (contextType == Context.Memory)
     {
         //iContext = MemoryContext;
     }
 }
    private static async Task TryGetDepartmentFromBody(HttpContext context, IDepartmentContext departmentContext)
    {
        using (var sr = new StreamReader(context.Request.Body))
        {
            var bodyText = await sr.ReadToEndAsync();

            var department = JsonConvert.DeserializeObject <Department>(bodyText);
            if (department != null)
            {
                departmentContext.DepartmentId = department.DepartmentId;
            }
        }
    }
 public DepartmentRepo(IDepartmentContext context)
 {
     p_context = context;
 }
Beispiel #8
0
 public DepartmentService(IDepartmentContext context, IUserContext userContext)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }
 public DepartmentRepository(IDepartmentContext context)
 {
     this.context = context ?? throw new NullReferenceException("De afdelingContext is leeg.");
 }
Beispiel #10
0
 public DepartmentService(IDepartmentContext context)
 {
     this.context = context;
 }