[HttpPost] // Poderia ser usado um create public IActionResult Post([FromBody] Book book) // Esse trecho faz um cast do body recebido para um objeto pessoa { if (book == null) { return(BadRequest()); } return(Ok(_bookBusiness.Create(book))); }
[HttpPost] // Poderia ser usado um create public IActionResult Post([FromBody] Person person) // Esse trecho faz um cast do body recebido para um objeto pessoa { if (person == null) { return(BadRequest()); } return(Ok(_personBusiness.Create(person))); }
public IActionResult Post([FromBody] BookVO book) { if (book == null) { return(BadRequest("We were unable to insert this book.")); } BookVO books = _bookBusiness.Create(book); if (books == null) { return(BadRequest("We were unable to insert this book.")); } return(Ok(_bookBusiness.Create(book))); }
public IActionResult Post([FromBody] BookValue value, [FromServices] IBookBusiness bookBusiness, [FromServices] IMapper mapper) { var bookDomain = mapper.Map <Book>(value); var bookCreated = mapper.Map <BookValue>(bookBusiness.Create(bookDomain)); return(Created("Post:Book", bookCreated)); }
[TypeFilter(typeof(HyperMediaFilter))] // Anotação para o HATEOAS public IActionResult Post([FromBody] BookVO book) { if (book == null) { return(BadRequest()); } return(Ok(_bookBusiness.Create(book))); }
public IActionResult Post([FromBody] Book book) { if (book == null) { return BadRequest(); } return new ObjectResult(_bookBusiness.Create(book)); }
public IActionResult Post([FromBody] BookDTO book) { if (book == null) { return(NotFound()); } return(new ObjectResult(_bookBusiness.Create(book))); }
public ActionResult Post([FromBody] BookVO book) { if (book == null) { return(BadRequest()); } return(new ObjectResult(_booksBusiness.Create(book))); }
public IActionResult Post([FromBody] BookVO book) { if (book.IsNull()) { return(BadRequest()); } return(new ObjectResult(_bookBusiness.Create(book))); }
public JsonResult Create([Bind(Exclude = "BookID")] Book book) { if (ModelState.IsValid) { bookBusiness.Create(book); } return(Json(book, JsonRequestBehavior.AllowGet)); }
public IActionResult Post([FromBody] Book book) { if (book == null) { return(BadRequest("Deu ruim aqui fera")); } return(Ok(_bookBusiness.Create(book))); }
public IActionResult Post([FromBody] BookVO book) { if (book == null) { return(BadRequest("Invalid book")); } return(new CreatedResult("", _business.Create(book))); }
public ActionResult Post([FromBody] BookInVO book) { try { var _entity = book.CreateEntity(); _bookBusiness.Create(ref _entity); var _result = _entity.CreateVO <Book, BookOutVO>(); return(Accepted(_result)); } catch (Exception ex) { return(this.ReturnActionResult(ex)); } }
public IActionResult Post(Book book) { try { if (book != null) { return(Ok(_bookBusiness.Create(book))); } else { return(NotFound()); } } catch (Exception) { return(BadRequest()); } }
public IActionResult Post([FromBody] BookVO books) { return(new ObjectResult(_converter.Parse(_bookBusiness.Create(books)))); }
public IActionResult Post([FromBody] Books books) { return(new ObjectResult(_bookBusiness.Create(books))); }
public IActionResult CreateBook([FromBody] Book book) { return(Ok(_business.Create(book))); }
public async Task <Book> Create([FromBody] Book newBook) { return(await business.Create(newBook)); }
public IActionResult Post([FromBody] BookVO book) { return(book == null ? (IActionResult)BadRequest() : Ok(new ObjectResult(_bookBusiness.Create(book)).Value)); }
public void Create([FromBody] BookCreate bookCreate) => bookBusiness.Create(bookCreate);
public IActionResult Post([FromBody] BookVO book) { return(Ok(_bookBusiness.Create(book))); }
public IActionResult Create([FromBody] Book item) { if (item == null) return BadRequest(); return Ok(_bookBusiness.Create(item)); }