public async Task <IActionResult> AddAuthor([FromBody] AddAuthorParameter author)
        {
            var isAdded = await _authorBusiness.AddAuthor(author);

            if (isAdded)
            {
                return(Ok("Saved Successfully"));
            }
            return(NoContent());
        }
Exemple #2
0
        public async Task <IActionResult> Create(AddAuthorParameter author)
        {
            if (ModelState.IsValid)
            {
                var isAdded = await _authorBusiness.AddAuthor(author);

                if (isAdded)
                {
                    return(RedirectToAction("Index"));
                }
            }

            return(View(author));
        }