public async Task UpsertGallery(GalleryDto input) { try { var obj = input.MapTo <Gallery>(); if (input.Id == 0) { obj.IsDeleted = false; obj.CreatedBy = AbpSession.UserId; obj.DateCreated = DateTime.Now; obj.DateModified = null; } else { obj.ModifiedBy = AbpSession.UserId; obj.DateModified = DateTime.Now; } await _galleryRepository.InsertOrUpdateAsync(obj); } catch (Exception ex) { throw ex; } }
public GalleryViewModel(GalleryDto output) { output.MapTo(this); }