Ejemplo n.º 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);
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 5
0
 public void UpdateNoReturnAsync(TestTypeMinimal dalTestTypeMinimal)
 {
     RepoDbSet.Update(_mapper.MapToDomain(dalTestTypeMinimal));
 }
Ejemplo n.º 6
0
 public void UpdateNoReturnAsync(ComponentMinimal dalComponentFull)
 {
     RepoDbSet.Update(_mapper.MapToDomain(dalComponentFull));
 }
Ejemplo n.º 7
0
 public void UpdateNoReturnAsync(UnitOfMeasureMinimal dalUnitOfMeasureMinimal)
 {
     RepoDbSet.Update(_mapper.MapToDomain(dalUnitOfMeasureMinimal));
 }
 public void UpdateNoReturnAsync(ComponentTypeSpecificationMinimal dalComponentTypeSpecificationMinimal)
 {
     RepoDbSet.Update(_mapper.MapToDomain(dalComponentTypeSpecificationMinimal));
 }
Ejemplo n.º 9
0
 public void UpdateBaseRoutine(DTO.WorkoutRoutine routine)
 {
     RepoDbSet.Update(Mapper.MapDALToDomain(routine));
 }
Ejemplo n.º 10
0
 public void UpdateNoReturnAsync(CompatibilityMinimal dalCompatibilityMinimal)
 {
     RepoDbSet.Update(_mapper.MapToDomain(dalCompatibilityMinimal));
 }
Ejemplo n.º 11
0
 public void UpdateNoReturnAsync(ManufacturerMinimal dalManufacturerMinimal)
 {
     RepoDbSet.Update(_mapper.MapToDomain(dalManufacturerMinimal));
 }