public async Task <IActionResult> Edit(int id, ClothesFormServiceModel model) { await this.clothes.EditAsync( id, model.Name, model.Type, model.Quantity, model.Size, model.SinglePrice, model.PictureUrl, model.Description); return(RedirectToAction(nameof(Details), new { id = id })); }
public async Task <IActionResult> Add(ClothesFormServiceModel model) { if (!ModelState.IsValid) { return(View(model)); } var user = await this.userManager.GetUserAsync(User); await this.clothes.AddAsync( user.Id, model.Name, model.Type, model.Quantity, model.Size, model.SinglePrice, model.PictureUrl, model.Description); return(RedirectToAction(nameof(HomeController.Index), "Home")); }