Ejemplo n.º 1
0
        public async Task <IResult> DeleteAsync(WorkArea entity)
        {
            ImageProcessHelper.Delete(entity.Picture);
            await _workArea.DeleteAsync(entity);

            return(new SuccessResult());
        }
Ejemplo n.º 2
0
        public async Task <IResult> DeleteAsync(Article entity)
        {
            ImageProcessHelper.Delete(entity.Picture);

            await _articleDal.DeleteAsync(entity);

            return(new SuccessResult());
        }
Ejemplo n.º 3
0
        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());
        }