public IActionResult AddBook(Book b) { try { log.LogInformation("Executing GetCategoy method"); log.LogInformation("This is a Test Message"); } catch (Exception e) { log.LogCritical(e.Message); log.LogInformation("Executed GetCategoy Method.."); } service.AddBookRecord(b); service.context = HttpContext; return(RedirectToAction("AddBook")); }