public ActionResult Index() { var books = BookAPI.GetAllBooks(); UserDTO user = null; if (User.Identity.IsAuthenticated) { user = UserAPI.GetUser(User.Identity.Name); } var model = new HomePageModel { Books = books, User = user }; return(View(model)); }