Exemple #1
0
 /// <summary>
 /// Get method
 /// </summary>
 /// <param name="phoneUserId"></param>
 /// <returns>return the user by id </returns>
 public IActionResult OnGet(int phoneUserId)
 {
     PhoneUser = repository.GetUserById(phoneUserId);
     if (PhoneUser == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
 /// <summary>
 ///
 /// if id not found return the page not found
 /// </summary>
 /// <param name="phoneUserId"></param>
 /// <returns> retrieve the user by id</returns>
 public IActionResult OnGet(int?phoneUserId)
 {
     PhoneType = htmlHelper.GetEnumSelectList <PhoneType>();
     if (phoneUserId.HasValue)
     {
         PhoneUser = repository.GetUserById(phoneUserId.Value);
         //return RedirectToPage("./NotFound");
     }
     else
     {
         // return RedirectToPage("./NotFound");
         PhoneUser = new PhoneUser();
     }
     if (PhoneUser == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
Exemple #3
0
 public PhoneUser Get(int id)
 {
     return(repository.GetUserById(id));
 }