Ejemplo n.º 1
0
        public ActionResult Details(Guid id)
        {
            QueryServiceClient queryService = new QueryServiceClient();
            var book = queryService.GetBookByGuid(id);

            queryService.Close();
            return(View(book));
        }
Ejemplo n.º 2
0
        public ActionResult Return(Guid id)
        {
            QueryServiceClient queryService = new QueryServiceClient();
            var book = queryService.GetBookByGuid(id);
            var user = queryService.GetUserByUserName(User.Identity.Name);

            queryService.Close();

            CommandServiceClient commandService = new CommandServiceClient();

            commandService.ReturnBookFromUser(book.AggregateRootId, user.AggregateRootId);
            commandService.Close();

            return(RedirectToAction("MyAccount", "Account"));
        }