public PhotoGalleryAddOrUpdateResponseDto AddOrUpdate(PhotoGalleryAddOrUpdateRequestDto request)
        {
            var entity = _repository.GetAll()
                         .FirstOrDefault(x => x.Id == request.Id && x.IsDeleted == false);

            if (entity == null)
            {
                _repository.Add(entity = new Models.PhotoGallery());
            }
            entity.Name = request.Name;
            _uow.SaveChanges();
            return(new PhotoGalleryAddOrUpdateResponseDto(entity));
        }
 public PhotoGalleryDto(Models.PhotoGallery entity)
 {
     Id   = entity.Id;
     Name = entity.Name;
 }
예제 #3
0
 public PhotoGalleryAddOrUpdateResponseDto(Models.PhotoGallery entity)
     : base(entity)
 {
 }