public ReservationManagerInfoDto Create(ReservationManagerInfoCreateOrupdateDto inputDto)
        {
            var resManager =
                new ReservationManagerInfo(GuidGenerator.Create(), inputDto.Name, inputDto.OpenDays);

            CreateResCondition(inputDto.ConditionCreateDtos,
                               resManager.ReservationConditions, resManager.Id);
            var resManagerDto = _rmInfoRepository.InsertAsync(resManager).Result;

            CurrentUnitOfWork.CompleteAsync();
            return(ObjectMapper.Map <ReservationManagerInfo, ReservationManagerInfoDto>(resManagerDto));
        }
        public ReservationManagerInfoDto Update(Guid id, ReservationManagerInfoCreateOrupdateDto inputDto)
        {
            var entity = _rmInfoRepository.FindAsync(id).Result;

            if (entity == null)
            {
                throw new EntityNotFoundException(typeof(ReservationManagerInfo), entity.Id);
            }
            entity.SetOpenDays(inputDto.OpenDays);
            entity.SetIncludeDay(inputDto.IncludeDay);
            return(ObjectMapper.Map <ReservationManagerInfo, ReservationManagerInfoDto>(
                       _rmInfoRepository.UpdateAsync(entity).Result));
        }
示例#3
0
 public ReservationManagerInfoDto Update(Guid id, ReservationManagerInfoCreateOrupdateDto inputDto)
 {
     return(_resMangerAppService.Update(id, inputDto));
 }
示例#4
0
 public ReservationManagerInfoDto Create(ReservationManagerInfoCreateOrupdateDto inputDto)
 {
     return(_resMangerAppService.Create(inputDto));
 }