public ActionResult <String> Delete(int id)
 {
     try
     {
         return(Ok(_service.Delete(id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
        public async Task <ActionResult <String> > Delete(int id)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                return(Ok(_service.Delete(id, userInfo.Id)));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }
Example #3
0
        public async Task <ActionResult <WishList> > Delete(int id)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                //NOTE send userinfo.id so you can validate they are the creator of the original

                return(Ok(_service.Delete(id, userInfo.Id)));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }