public ActionResult <IEnumerable <Blog> > Get() { try { return(Ok(_bs.Get())); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ActionResult GetBlogById(string id) { var blog = _blogsService.Get(id); if (blog == null) { return(NotFound(new Response <string>(new BlogIdError()) { resultBody = "" })); } return(Ok(new Response <Blog>(new Ok()) { resultBody = blog })); }
public ActionResult <IEnumerable <Blog> > Get() { try { return(Ok(_blogsService.Get())); } catch (System.Exception err) { return(BadRequest(err)); } }