Exemplo n.º 1
0
 public ActionResult <Bid> Create([FromBody] Bid newBid)
 {
     try
     {
         return(Ok(_service.Create(newBid)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Exemplo n.º 2
0
 public ActionResult <Bid> Create([FromBody] Bid bid)
 {
     try
     {
         return(Ok(_service.Create(bid)));
     }
     catch (System.Exception error)
     {
         return(BadRequest(error.Message));
     }
 }
Exemplo n.º 3
0
 public ActionResult <string> Create([FromBody] Bid newBid)
 {
     try
     {
         _service.Create(newBid);
         return(Ok("success"));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Exemplo n.º 4
0
        public async Task <ActionResult <string> > Create([FromBody] Bid newBid)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                _service.Create(newBid, userInfo);
                return(Ok("Success!"));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }