public GetTeamStatisticsByGameId(
     IMapper mapper,
     IQueryDbContext sqlCommand)
 {
     _mapper     = mapper;
     _sqlCommand = sqlCommand;
 }
 public GetLeaguesByPlayer(
     IMapper mapper,
     IQueryDbContext sqlCommand)
 {
     _mapper     = mapper;
     _sqlCommand = sqlCommand;
 }
        private Task SyncAmenityAsync(IQueryDbContext queryDb, Domain.Entities.Amenity dbAmenity, CancellationToken stoppingToken)
        {
#pragma warning disable CS0251 // Indexing an array with a negative index (Justification: Element at negative index translates to $ - has special meaning to MongoDB.Driver)

            var filter = Builders <ApartmentModel> .Filter.ElemMatch(a => a.Amenities, amenity => amenity.Id == dbAmenity.Id);

            var update = Builders <ApartmentModel> .Update.Set(a => a.Amenities[-1].Name, dbAmenity.Name);

            if (dbAmenity.IsDeleted)
            {
                update = Builders <ApartmentModel> .Update.PullFilter(a => a.Amenities, amenity => amenity.Id == dbAmenity.Id);
            }

            return(queryDb.Apartments.UpdateManyAsync(filter, update));

#pragma warning restore CS0251
        }
Exemple #4
0
        private Task SyncApartmentAsync(IQueryDbContext queryDb, Domain.Entities.Apartment dbApartment, CancellationToken stoppingToken)
        {
            var filter = Builders <ApartmentModel> .Filter.Eq(u => u.Id, dbApartment.Id);

            if (dbApartment.IsDeleted)
            {
                return(queryDb.Apartments.DeleteOneAsync(filter, stoppingToken));
            }

            var replacement = MapToQueryModel(dbApartment);
            var options     = new ReplaceOptions()
            {
                IsUpsert = true
            };

            return(queryDb.Apartments.ReplaceOneAsync(filter, replacement, options, stoppingToken));
        }
Exemple #5
0
 public CustomerDetailsHandler(IQueryDbContext db, ILogger <CustomerDetailsHandler> logger)
 {
     _db     = db;
     _logger = logger;
 }
 public GetAllUsersQueryHandler(IQueryDbContext context)
 {
     this.context = context;
 }
 public WorkoutTemplateQueryHandler(IQueryDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemple #8
0
 public GetAllApartmentsQueryHandler(IQueryDbContext context)
 {
     this.context = context;
 }
 public GetUserByUsernameQueryHandler(IQueryDbContext context)
 {
     this.context = context;
 }
Exemple #10
0
 public AccountEventsHandler(IQueryDbContext db, ILogger <AccountEventsHandler> logger)
 {
     _db     = db;
     _logger = logger;
 }
Exemple #11
0
 public GetHostQueryHandler(IQueryDbContext context)
 {
     this.context = context;
 }
 public GetAllGuestsQueryHandler(IQueryDbContext context)
 {
     this.context = context;
 }
Exemple #13
0
 public CustomerByIdHandler(IQueryDbContext db)
 {
     _db = db;
 }
Exemple #14
0
 public CustomersArchiveHandler(IQueryDbContext db, ILogger <CustomersArchiveHandler> logger)
 {
     _db     = db;
     _logger = logger;
 }
Exemple #15
0
 public AccountByIdHandler(IQueryDbContext db)
 {
     _db = db;
 }
Exemple #16
0
 public GetAllReservationsQueryHandler(IQueryDbContext context)
 {
     this.context = context;
 }
Exemple #17
0
 public CustomersArchiveHandler(IQueryDbContext db)
 {
     _db = db;
 }
 public ExerciseQueryHandler(IQueryDbContext dbContext)
 {
     _dbContext = dbContext;
 }