public async Task <IActionResult> Get(ObjectId objectId) { if (objectId == ObjectId.Empty) { return(BadRequest()); } var result = await _writerService.GetById(objectId); return(Ok(result)); }
public ActionResult AddBook(Book book) { var ktg = categoryManager.GetById(book.CategoryId); var wrt = writerManager.GetById(book.WriterId); book.Category = ktg; book.Writer = wrt; bookManager.Add(book); return(RedirectToAction("Index")); }
public ActionResult GetWriter(int id) { var value = writerManager.GetById(id); return(View("GetWriter", value)); }