public async Task <IResult> DeleteAsync(WorkArea entity) { ImageProcessHelper.Delete(entity.Picture); await _workArea.DeleteAsync(entity); return(new SuccessResult()); }
public async Task <IResult> DeleteAsync(Article entity) { ImageProcessHelper.Delete(entity.Picture); await _articleDal.DeleteAsync(entity); return(new SuccessResult()); }
public async Task <IResult> UpdateAsync(Article entity, IFormFile file) { ImageProcessHelper.Delete(entity.Picture); entity.Picture = Guid.NewGuid() + Path.GetExtension(file.FileName); await ImageProcessHelper.UploadAsync(entity.Picture, FolderDirectories.ArticleFolder, file); entity.Title = StringHelper.TitleToPascalCase(entity.Title); entity.Url = StringHelper.FriendlyUrl(entity.Title); await _articleDal.UpdateAsync(entity); return(new SuccessResult()); }