public ActionResult <string> Create([FromBody] WishListProduct newWLP) { try { _service.Create(newWLP); return(Ok("success")); } catch (System.Exception e) { return(BadRequest(e.Message)); } }
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)); } }