Exemplo n.º 1
0
 public IActionResult OnGet(int id)
 {
     Movie = queryService.GetById(id, true).Result;
     if (Movie == null)
     {
         return(NotFound());      // Deliberately sending a NotFound for App Insights to catch
     }
     return(Page());
 }
Exemplo n.º 2
0
 public IActionResult OnGet(int id)
 {
     Movie = queryService.GetById(id).Result;
     if (Movie == null)
     {
         return(RedirectToPage("../NotFound"));
     }
     return(Page());
 }
Exemplo n.º 3
0
        public async Task <IActionResult> OnGetAsync(int id)
        {
            Movie = await queryService.GetById(id, true);

            if (Movie == null)
            {
                loggerDebug.LogWarning($"[ViewMovie][OnGet] The movie Id {id} was not found");
                //return NotFound();      // Deliberately sending a NotFound for App Insights to catch
                return(RedirectToPage("../NotFound"));
            }
            return(Page());
        }
Exemplo n.º 4
0
 public IActionResult OnGet(int?id)
 {
     if (id.HasValue)
     {
         PageTitle = "Edit Movie";
         Movie     = queryService.GetById(id.Value).Result;
     }
     else
     {
         PageTitle = "Add Movie";
         Movie     = new Movie();
     }
     if (Movie == null)
     {
         return(RedirectToPage("../NotFound"));
     }
     return(Page());
 }