コード例 #1
0
 public ActionResult <IEnumerable <Blog> > GetBlogs(string id)
 {
     try
     {
         return(Ok(_admservice.GetBlogsByProfileId(id)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
コード例 #2
0
        public async Task <ActionResult <IEnumerable <Blog> > > GetBlogs()
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                return(Ok(_bservice.GetBlogsByProfileId(userInfo.Id)));
            }
            catch (System.Exception e)
            {
                return(BadRequest(e.Message));
            }
        }