Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Title,Description,Price")] Product product)
        {
            if (ModelState.IsValid)
            {
                product.UserProfileId = _userProfileManager.GetUserProfileId(User);
                product.CreatedOn     = DateTime.Now;
                await _productsManager.CreateAsync(product);

                return(RedirectToAction(nameof(Products)));
            }
            return(View(product));
        }