Ejemplo n.º 1
0
        public async Task <IActionResult> Create()
        {
            var model = new CreateApplicationViewModel();
            await model.LoadTransportAsync(_ctx);

            return(View(model));
        }
Ejemplo n.º 2
0
        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));
        }