public async Task <ActionResult> Create([Bind(Include = nameof(GeoNamesRequestModel.Names))] GeoNamesRequestModel model) { try { if (this.ModelState.IsValid) { await this.service.InsertAsync(model); } string returnUrl = this.Request[ContextKeys.ReturnUrl]; if (!string.IsNullOrWhiteSpace(returnUrl)) { return(this.Redirect(returnUrl)); } } catch (Exception ex) { this.logger?.Log(ex, ControllerName); } return(this.RedirectToAction(IndexActionName)); }
public async Task InsertAsync(GeoNamesRequestModel model) { await this.service.InsertAsync(model.ToArray()); }