public IActionResult OnGet() { if (Quote.Id != 0) { return(RedirectToPage("./Edit")); } Quote = new SamuraiApp.Domain.Quotes(); var list = samurairepo.GetSamurais().ToList().Select(x => new { Id = x.Id, SamuraiName = $"{x.Name}" }); Samurais = new SelectList(list, "Id", "SamuraiName"); return(Page()); }
public IActionResult OnGet(int?id) { if (id == null) { SecretIdentity = new SamuraiApp.Domain.SecretIdentity(); } SecretIdentity = repo.GetSecretIdentity(id.Value); if (SecretIdentity == null) { return(NotFound()); } var list = samurairepo.GetSamurais().ToList().Select(x => new { Id = x.Id, SamuraiName = $"{x.Name}" }); Samurais = new SelectList(list, "Id", "SamuraiName"); return(Page()); }
public IActionResult OnGet(int?id) { if (id == null) { return(NotFound()); } Quote = repository.GetQuoteById(id.Value); if (Quote == null) { return(NotFound()); } var list = samurairepo.GetSamurais().ToList().Select(x => new { Id = x.Id, SamuraiName = $"{x.Name}" }); Samurais = new SelectList(list, "Id", "SamuraiName"); return(Page()); }
public void OnGet() { Samurais = _context.GetSamurais(); }