public bool EditArticle(ArticleUpdateModel articleUpdateModel)
        {
            var article = articleRepository.GetById(articleUpdateModel.Id);

            if (articleUpdateModel != null && article != null)
            {
                article.Title = articleUpdateModel.Title;
                article.Body  = articleUpdateModel.Body;
                article.Image = StaticFunctions.GetBytesFromFile(articleUpdateModel.Image);
                articleRepository.Update(article);
                return(true);
            }
            else
            {
                return(false);
            }
        }
 public BaseResponseModel PostEdit([FromForm] ArticleUpdateModel articleUpdateModel)
 {
     try
     {
         var result = articleService.EditArticle(articleUpdateModel);
         if (result)
         {
             return(new SuccessResponseModel <bool>(result));
         }
         else
         {
             return(new BaseResponseModel(ReadOnlyValues.ArticleNotFound));
         }
     }
     catch (Exception ex)
     {
         return(new BaseResponseModel(ex.Message));
     }
 }
 public IActionResult Edit(ArticleUpdateModel articleUpdateModel)
 {
     if (ModelState.IsValid)
     {
         var editRes = PostMultipartForm <bool>(MyApiRequestModel.PostArticleEdit, articleUpdateModel, true);
         var checkEditBaseControllerError = CheckBaseControllerError(editRes);
         if (checkEditBaseControllerError == null)
         {
             return(Detail(articleUpdateModel.Id));
         }
         else
         {
             return(Error(checkEditBaseControllerError));
         }
     }
     else
     {
         return(Edit(articleUpdateModel.Id.ToString()));
     }
 }