public async Task <IActionResult> Create() { var model = new CreateApplicationViewModel(); await model.LoadTransportAsync(_ctx); return(View(model)); }
public async Task <IActionResult> Create(CreateApplicationViewModel model, [FromServices] ICryptoServices crypto) { if (ModelState.IsValid) { var app = await model.SaveChangesAsync(_ctx, crypto); return(RedirectToAction(nameof(Details), new { id = app.Id })); } await model.LoadTransportAsync(_ctx); return(View(model)); }