public async Task <IActionResult> CreateType(ProductTypesCreateInputModel productTypesCreateInputModel) { if (!this.ModelState.IsValid) { return(this.View(productTypesCreateInputModel)); } await this.productsService.CreateProductTypeAsync(productTypesCreateInputModel.Name); return(this.RedirectToAction(nameof(this.CreateType))); }
public async Task <IActionResult> CreateType(ProductTypesCreateInputModel serviceModel) { if (!ModelState.IsValid) { return(this.View(serviceModel)); } ProductTypeServiceModel product = new ProductTypeServiceModel { Name = serviceModel.Name, }; await this.productsServices.CreateType(product); return(this.Redirect(ServicesGlobalConstants.RedirectProductCreate)); }