public async Task <IHttpActionResult> AddBook([FromBody] BookRepresentation Book) { if (!ModelState.IsValid) { return(BadRequest()); } var result = await _bookRepository.Add(Book.ToEntity()); return(Ok(result.ToRepresentation())); }
public async Task <IHttpActionResult> UpdateBook([FromUri] Guid id, [FromBody] BookRepresentation Book) { if (!ModelState.IsValid) { return(BadRequest()); } await _bookRepository.Update(id, Book.ToEntity()); return(Ok()); }