public async Task CreateNewWorkAsync(ConstructionCategoriesInputModel input) { var category = input.To <ConstructionCategory>(); await this.context.ConstructionCategories.AddAsync(category); await this.context.SaveChangesAsync(); }
public async Task <IActionResult> Create(ConstructionCategoriesInputModel input) { if (!this.ModelState.IsValid) { return(this.View()); } await this.constructionCategoriesService.CreateNewWorkAsync(input); return(this.Redirect("/ConstructionCategories/All")); }