Exemple #1
0
        public async void UpdateUserInTraining(DAL.App.DTO.UserInTraining userInTraining)
        {
            var usr = await RepoDbSet.FindAsync(userInTraining.Id);

            usr.AttendingTraining = userInTraining.AttendingTraining;
            RepoDbSet.Update(usr);
        }
Exemple #2
0
        public async Task <DTO.WorkoutRoutine> ChangeRoutinePublishStatus(Guid routineId, bool isPublished)
        {
            var routineToPublish = await RepoDbSet.FindAsync(routineId);

            routineToPublish.CreatedAt = isPublished ? DateTime.Now : DateTime.MaxValue;
            RepoDbSet.Update(routineToPublish);
            return(Mapper.MapDomainToDAL(routineToPublish));
        }
        public async Task <DAL.App.DTO.Notification> UpdateNotification(DAL.App.DTO.Notification notification)
        {
            var domain = await RepoDbSet.FindAsync(notification.Id);

            domain.Recived = true;
            var addedNotification = RepoDbSet.Update(domain).Entity;

            return(NotificationMapper.Map(addedNotification));
        }
Exemple #4
0
        public override async Task <Category> UpdateAsync(Category entity, object?userId = null)
        {
            var domainEntity = DALMapper.Map(entity);

            // fix the language string - from mapper we get new ones - so duplicate values will be created in db
            // load back from db the originals
            domainEntity.Name = await RepoDbContext.LangStrings.Include(t => t.Translations).FirstAsync(s => s.Id == domainEntity.NameId);

            domainEntity.Name.SetTranslation(entity.Name);

            await CheckDomainEntityOwnership(domainEntity, userId);

            var trackedDomainEntity = RepoDbSet.Update(domainEntity).Entity;
            var result = DALMapper.Map(trackedDomainEntity);

            return(result);
        }
Exemple #5
0
 public void UpdateNoReturnAsync(TestTypeMinimal dalTestTypeMinimal)
 {
     RepoDbSet.Update(_mapper.MapToDomain(dalTestTypeMinimal));
 }
Exemple #6
0
 public void UpdateNoReturnAsync(ComponentMinimal dalComponentFull)
 {
     RepoDbSet.Update(_mapper.MapToDomain(dalComponentFull));
 }
Exemple #7
0
 public void UpdateNoReturnAsync(UnitOfMeasureMinimal dalUnitOfMeasureMinimal)
 {
     RepoDbSet.Update(_mapper.MapToDomain(dalUnitOfMeasureMinimal));
 }
 public void UpdateNoReturnAsync(ComponentTypeSpecificationMinimal dalComponentTypeSpecificationMinimal)
 {
     RepoDbSet.Update(_mapper.MapToDomain(dalComponentTypeSpecificationMinimal));
 }
Exemple #9
0
 public void UpdateBaseRoutine(DTO.WorkoutRoutine routine)
 {
     RepoDbSet.Update(Mapper.MapDALToDomain(routine));
 }
 public void UpdateNoReturnAsync(CompatibilityMinimal dalCompatibilityMinimal)
 {
     RepoDbSet.Update(_mapper.MapToDomain(dalCompatibilityMinimal));
 }
Exemple #11
0
 public void UpdateNoReturnAsync(ManufacturerMinimal dalManufacturerMinimal)
 {
     RepoDbSet.Update(_mapper.MapToDomain(dalManufacturerMinimal));
 }