Example #1
0
        private async static Task CreateRootUser(IWebHost host)
        {
            using (IServiceScope scope = host.Services.CreateScope())
            {
                IStudentManagmentService studMngService =
                    scope.ServiceProvider.GetRequiredService <IStudentManagmentService>();
                IConfiguration  config  = host.Services.GetRequiredService <IConfiguration>();
                RegisterRootDTO rootDto = new RegisterRootDTO();
                config.GetSection("RootUser").Bind(rootDto);

                if (!await studMngService.IsStudentRegistered(rootDto.Email))
                {
                    await studMngService.RegisterRootUser(rootDto);
                }
            }
        }
 public RegisterController(IStudentManagmentService studentManagmentService, IMapper mapper, IStudentService studentService)
 => (_studentManagmentService, _mapper, _studentService) = (studentManagmentService, mapper, studentService);
Example #3
0
 public StudentController(
     IStudentManagmentService studMngService,
     IStudentService studService,
     IMapper mapper,
     IStringLocalizer <SharedResource> localizer)
 => (_studMngService, _mapper, _localizer, _studService)
Example #4
0
 public AdminApiController(IStudentService studentService, IMapper mapper, IStudentManagmentService studMngService)
 => (_studentService, _mapper, _studMngService)