abp(net core)+easyui+efcore实现仓储管理系统――领域层创建实体(三)
abp(net core)+easyui+efcore实现仓储管理系统――定义仓储并实现 (四)
abp(net core)+easyui+efcore实现仓储管理系统――创建应用服务(五)
abp(net core)+easyui+efcore实现仓储管理系统――展现层实现增删改查之控制器(六)
abp(net core)+easyui+efcore实现仓储管理系统――展现层实现增删改查之列表视图(七)
abp(net core)+easyui+efcore实现仓储管理系统――展现层实现增删改查之增删改视图(八)
abp(net core)+easyui+efcore实现仓储管理系统――展现层实现增删改查之菜单与测试(九)
abp(net core)+easyui+efcore实现仓储管理系统――多语言(十)
abp(net core)+easyui+efcore实现仓储管理系统――使用 WEBAPI实现CURD (十一)
abp(net core)+easyui+efcore实现仓储管理系统――菜单-上 (十六)
abp(net core)+easyui+efcore实现仓储管理系统――EasyUI前端页面框架 (十八)
abp(net core)+easyui+efcore实现仓储管理系统――EasyUI之货物管理一 (十九)
abp(net core)+easyui+efcore实现仓储管理系统――EasyUI之货物管理二 (二十)
abp(net core)+easyui+efcore实现仓储管理系统――EasyUI之货物管理五 (二十三) 文章中,我们修正了一些BUG,让货物信息管理的前端与后台功能基本实现了我们所要。现在我们运行起应用程序看看新增功能。
十五、新增货物信息
protected dynamic JsonEasyUIResult(int id,string result) { string strId = string.Empty; if (id>0) { strId = id.ToString(); } var obj = new { result = result, Id = strId }; var json = ABP.TPLMS.Helpers.JsonHelper.Instance.Serialize(obj); return json; }
public ActionResult Add(CargoDto createDto) { var json = string.Empty; string result = "NO"; if (createDto == null) { json = JsonEasyUIResult(0, result); return Content(json); } try { var cargo = ObjectMapper.Map<CreateUpdateCargoDto>(createDto); // TODO: Add logic here var obj = _cargoAppService.Create(cargo); int id = obj.GetAwaiter().GetResult().Id; if (obj != null) { json = JsonEasyUIResult(id, "OK"); } else { json = JsonEasyUIResult(0,result); } } catch { } return Content(json); }
abp(net core)+easyui+efcore实现仓储管理系统――菜单-上 (十六) )。
具体错误信息如下:
AbpValidationException: Method arguments are not valid! See ValidationErrors for details.
Abp.Runtime.Validation.Interception.MethodInvocationValidator.ThrowValidationError() in MethodInvocationValidator.cs, line 118
EnableValidation和DisableValidation 用来控制validation。我们在Add方法上面添加两个特性[HttpPost]与[DisableValidation]。
[HttpPost] [DisableValidation] public ActionResult Add(CargoDto createDto) {… 代码见第2步。}
10.重新从第3步到第7步。这次保存成功。见下图。
来源:博客园
作者:DotNet菜园
链接:https://www.cnblogs.com/chillsrc/p/11770233.html