public async Task <bool> UpdateAuthor(UpdateAuthorParameter author)
        {
            var authorEntity = Mapper.Map <UpdateAuthorParameter, Author>(author);

            UnitOfWork.Repo.Update(authorEntity);
            var result = await UnitOfWork.SaveChanges();

            return(result > 0);
        }
        public async Task <IActionResult> UpdateAuthor([FromBody] UpdateAuthorParameter author)
        {
            var isUpdated = await _authorBusiness.UpdateAuthor(author);

            if (isUpdated)
            {
                return(Ok("Updated Successfully"));
            }
            return(NoContent());
        }
示例#3
0
        public async Task <IActionResult> Edit(UpdateAuthorParameter author)
        {
            await _authorBusiness.UpdateAuthor(author);

            return(RedirectToAction("Index"));
        }