public GroupService( IApplicationDbContextFactory contextFactory, IRepository <Group> groupRepo) { _contextFactory = contextFactory; _groupRepo = groupRepo; }
public EditSubjectCommandHandler( IBus bus, IApplicationDbContextFactory dbContextFactory) { _bus = bus ?? throw new ArgumentNullException(nameof(bus)); _dbContextFactory = dbContextFactory; }
public CreateLessonCommandHandler( IQueryProcessor queryProcessor, IApplicationDbContextFactory dbContextFactory) { _queryProcessor = queryProcessor; _dbContextFactory = dbContextFactory; }
public UserService(IApplicationDbContextFactory applicationDbContextFactory, RoleManager <Role> roleManager, UserManager <User> userManager, IConfiguration configuration) { UserManager = userManager; RoleManager = roleManager; _configuration = configuration; _applicationDbContextFactory = applicationDbContextFactory; }
public AuthenticateService(UserManager <User> userManager, RoleManager <Role> roleManager, IApplicationDbContextFactory applicationDbContextFactory, IConfiguration configuration) { this.userManager = userManager; this.roleManager = roleManager; _configuration = configuration; this.applicationDbContextFactory = applicationDbContextFactory; }
public RandomData(IRepository <Person> personRepository, IApplicationDbContextFactory contextFactory) { _random = new Random(); _personRepository = personRepository; using (var context = contextFactory.Create(QueryTrackingBehavior.NoTracking)) { _personCount = personRepository.Count(context); } _indexes = new[] { 0, 1 }; _timerIntervals = new[] { 3000, 5000 }; _randomDataItems = _indexes.Select(_ => (RandomDataItem)null).ToArray(); _timers = _indexes.Select(index => new Timer(state => { var randomPersonIndex = GetNewRandomIndex(); using (var context = contextFactory.Create(QueryTrackingBehavior.NoTracking)) { _randomDataItems[index] = _personRepository .SkipTake(randomPersonIndex, 1, context, person => person.Group) .ToList() .Select(person => new RandomDataItem { Index = index, Id = person.Id, Person = $"{person.Forenames} {person.Surname}", Group = person.Group.Name }) .First(); } Changed(nameof(Data)); PushUpdates(); }, null, 0, _timerIntervals[index])).ToArray(); }
public UnitOfWorkFactory(IApplicationDbContextFactory applicationDbContextFactory) { if (applicationDbContextFactory == null) { throw new ArgumentNullException(nameof(applicationDbContextFactory)); } _applicationDbContextFactory = applicationDbContextFactory; }
private string Schedule => "*/10 * * * * *"; //Runs every 10 seconds public LeadShcedulerService(IApplicationDbContextFactory applicationDbContextFactory) { ApplicationDbContextFactory = applicationDbContextFactory; _schedule = CrontabSchedule.Parse(Schedule, new CrontabSchedule.ParseOptions { IncludingSeconds = true }); _nextRun = _schedule.GetNextOccurrence(DateTime.Now); }
public EditClassroomCommandHandler( IBus bus, IApplicationDbContextFactory dbContextFactory, IQueryProcessor queryProcessor) { _bus = bus; _dbContextFactory = dbContextFactory; _queryProcessor = queryProcessor; }
public CreateExamCommandHandler( IBus bus, IApplicationDbContextFactory dbContextFactory, IQueryProcessor queryProcessor) { _bus = bus ?? throw new ArgumentNullException(nameof(bus)); _dbContextFactory = dbContextFactory; _queryProcessor = queryProcessor; }
public EditLessonCommandHandler( IBus bus, IQueryProcessor queryProcessor, IApplicationDbContextFactory dbContextFactory) { _queryProcessor = queryProcessor ?? throw new ArgumentNullException(nameof(queryProcessor)); _dbContextFactory = dbContextFactory; _bus = bus ?? throw new ArgumentNullException(nameof(bus)); }
public PersonService( IApplicationDbContextFactory contextFactory, IRepository <Person> personRepo, IRepository <Group> groupRepo, IPersonNameBuilder personNameBuilder) { _contextFactory = contextFactory; _personRepo = personRepo; _groupRepo = groupRepo; _personNameBuilder = personNameBuilder; }
public CreateUserCommandHandler( ICaptchaService captchaService, IBus bus, IIdentityClient identityClient, IQueryProcessor queryProcessor, IApplicationDbContextFactory dbContextFactory, ISabitClient sabitClient) { _captchaService = captchaService ?? throw new ArgumentNullException(nameof(captchaService)); _bus = bus ?? throw new ArgumentNullException(nameof(bus)); _identityClient = identityClient ?? throw new ArgumentNullException(nameof(identityClient)); _queryProcessor = queryProcessor; _dbContextFactory = dbContextFactory; _sabitClient = sabitClient; }
public SendSmsCommandHandler( ISmsCreditCalculator smsCreditCalculator, IBus bus, IHttpContextAccessor httpContextAccessor, IQueryProcessor queryProcessor, IApplicationDbContextFactory dbContextFactory) { _smsCreditCalculator = smsCreditCalculator ?? throw new ArgumentNullException(nameof(smsCreditCalculator)); _bus = bus ?? throw new ArgumentNullException(nameof(bus)); _httpContextAccessor = httpContextAccessor ?? throw new ArgumentNullException(nameof(httpContextAccessor)); _queryProcessor = queryProcessor ?? throw new ArgumentNullException(nameof(queryProcessor)); _dbContextFactory = dbContextFactory; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IApplicationDbContextFactory applicationDbContextFactory, UserManager <User> userManager, RoleManager <Role> roleManager) { app.UseSwagger(); app.UseHttpsRedirection(); app.UseCors("AllowPolicy"); app.UseRouting(); app.UseAuthentication(); app.UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "My API V1"); }); using (var context = applicationDbContextFactory.Create()) { context.AddCities(); context.AddStatuses(); context.AddFailureStatus(); context.AddCourses(); context.AddTeachers(); context.AddGroups(); context.AddLeads(); context.AddGroups(); roleManager.AddRoles().ConfigureAwait(false).GetAwaiter().GetResult(); userManager.AddUsers().ConfigureAwait(false).GetAwaiter().GetResult(); } }
public EndScanSessionCommandHandler(IApplicationDbContextFactory dbContextFactory, ILogger <EndScanSessionCommandHandler> logger) { _dbContextFactory = dbContextFactory; _logger = logger; }
public BulkEditScoreFormulaCommandHandler(IApplicationDbContextFactory dbContextFactory) { _dbContextFactory = dbContextFactory; }
public LeadCommentService(IApplicationDbContextFactory applicationDbContextFactory, UserManager <User> userManager) { UserManager = userManager; _applicationDbContextFactory = applicationDbContextFactory; }
public DeleteStudentCommandHandler(IBus bus, IApplicationDbContextFactory dbContextFactory) { _bus = bus; _dbContextFactory = dbContextFactory; }
public StatisticsService(IApplicationDbContextFactory applicationDbContextFactory) { _applicationDbContextFactory = applicationDbContextFactory; }
public Repository(IApplicationDbContextFactory contextFactory) { _contextFactory = contextFactory; }
public BulkEditContactsCommandHandler(IApplicationDbContextFactory dbContextFactory) { _dbContextFactory = dbContextFactory ?? throw new ArgumentNullException(nameof(dbContextFactory)); }
public UpdateUserByAdminCommandHandler( IIdentityClient identityClient, IApplicationDbContextFactory dbContextFactory) { _identityClient = identityClient ?? throw new ArgumentNullException(nameof(identityClient)); _dbContextFactory = dbContextFactory; }
public EditUnitCommandHandler(IApplicationDbContextFactory dbContextFactory, IQueryProcessor queryProcessor) { _dbContextFactory = dbContextFactory; _queryProcessor = queryProcessor; }
public PersonRepository(IApplicationDbContextFactory dbContextFactory) { this.dbContextFactory = dbContextFactory; }
public DeleteUnitCommandHandler(IApplicationDbContextFactory dbContextFactory) { _dbContextFactory = dbContextFactory; }
public CreateClassroomCommandHandler(IApplicationDbContextFactory dbContext, IQueryProcessor queryProcessor) { _dbContextFactory = dbContext ?? throw new ArgumentNullException(nameof(dbContext)); _queryProcessor = queryProcessor; }
public CustomerController(IApplicationDbContextFactory dbContextFactory) { this.dbContextFactory = dbContextFactory; }
public CityService(IApplicationDbContextFactory applicationDbContextFactory, UserManager <User> userManager) { _applicationDbContextFactory = applicationDbContextFactory; _userManager = userManager; }
public UnitOfWorkFactory(IApplicationDbContextFactory applicationDbContextFactory) { _applicationDbContextFactory = applicationDbContextFactory; }