Example #1
0
        public async Task <ActionResult> Create(Models.Product product)
        {
            if (ModelState.IsValid)
            {
                product.Id = Guid.NewGuid();
                await shopDbService.CreateAsync(product);

                return(RedirectToAction(nameof(Index)));
            }

            return(View());
        }
Example #2
0
        public async Task <ActionResult> Create(Models.Customer customer)
        {
            if (ModelState.IsValid)
            {
                customer.Id = Guid.NewGuid();
                await shopDbService.CreateAsync(customer);

                return(RedirectToAction(nameof(Index)));
            }

            return(View());
        }