示例#1
0
        public async Task <IActionResult> Create()
        {
            var model = new ServiceCreateInputModel
            {
                Types = await this.serviceService.GetAllTypesAsync() as ICollection <string>,
            };

            return(this.View(model));
        }
示例#2
0
        public async Task <IActionResult> Create(ServiceCreateInputModel model)
        {
            if (!this.ModelState.IsValid)
            {
                return(this.View(model));
            }

            await this.serviceService.CreateAsync <ServiceCreateInputModel>(model);

            return(this.Redirect("/Home/Index"));
        }