コード例 #1
0
        public async Task <IActionResult> Edit(ModuleModel model)
        {
            if (!ModelState.IsValid)
            {
                return(Json(ResultDto.Err((GetErrorFromModelStateStr()))));
            }

            var m = await ModuleApp.GetAsync(model.Id);

            if (m == null)
            {
                return(Json(ResultDto.Err(("数据不存在或已被删除"))));
            }

            m = model.MapToMeg <ModuleModel, Module>(m);
            var r = await ModuleApp.UpdateAsync(m);

            return(Json(r));
        }