public async Task <IActionResult> NewCategory(Category category) { try { var result = await blogService.AddCategory(category); var blogInfo = new BlogInfo { Id = result.Id }; return(Ok(blogInfo)); } catch (InternalException ie) { logger.LogError(500, ie, ie.Message, null); return(NotFound(ie.Message)); } catch (BadRequestException be) { logger.LogError(404, be, be.Message, null); return(BadRequest(be.Message)); } }
public CategoryContentViewModel Add(string title, string description) { return(_blogService.AddCategory(title, description)); }