示例#1
0
 public ActionResult <string> Create([FromBody] WishListProduct newWLP)
 {
     try
     {
         _service.Create(newWLP);
         return(Ok("success"));
     }
     catch (System.Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
示例#2
0
        public async Task <ActionResult <WishListProduct> > CreateAsync([FromBody] WishListProduct newWLP)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                newWLP.CreatorId = userInfo.Id;
                return(Ok(_service.Create(newWLP)));
            }
            catch (System.Exception err)
            {
                return(BadRequest(err.Message));
            }
        }