修改实体信息时,swagger所有的对象名都是小写的,提交的json大小写敏感
- Dominant language
- C#
- Stars
- 4.3k
- Forks
- 896
- PR merge metrics
- No merged PRs in 30d
Description
[toc]
## Swagger显示的样子

## 如果提交这个做修改的话,会修改不成功
```JSON
{
"entity": {
"Name": "哈哈哈fff",
"DisplayName": "哈哈哈fff",
"TypeId": "6facf25c-c7a4-4748-a2c7-2e9082d13690",
"Id": "ae881fb8-aa80-4bcb-acc0-10e9be498169",
"ImageId": "e59c5fdf-c13c-44ed-aab4-67b7e3dd3980",
"SoundId": "94905723-cb8f-42b4-85fc-9bbe275eda9f"
}
}
```
## 这样提交才可以
```json
{
"Entity": {
"Name": "哈哈哈fff",
"DisplayName": "哈哈哈fff",
"TypeId": "6facf25c-c7a4-4748-a2c7-2e9082d13690",
"Id": "ae881fb8-aa80-4bcb-acc0-10e9be498169",
"ImageId": "e59c5fdf-c13c-44ed-aab4-67b7e3dd3980",
"SoundId": "94905723-cb8f-42b4-85fc-9bbe275eda9f"
}
}
```
## 查看了源码在源码中有这么一段
在这个里面第520行
> WalkingTec.Mvvm.Core.BaseCRUDVM
```C#
if (!updateAllFields)
{
foreach (string key in this.FC.Keys)
{
if (key.StartsWith("Entity.") && !key.Contains("["))//在这里是否可以比较的时候忽略大小写,大小写敏感会出问题
{
string fieldName = key.Replace("Entity.", "");
try
{
this.DC.UpdateProperty(this.Entity, fieldName);//还有这里如果字段名是小写也会出现更新不了的问题
}
catch (Exception ex)
{
}
}
}
if (!typeof (TModel).GetTypeInfo().IsSubclassOf(typeof (BasePoco)))
return;
try
{
this.DC.UpdateProperty(this.Entity, "UpdateTime");
this.DC.UpdateProperty(this.Entity, "UpdateBy");
}
catch (Exception ex)
{
}
}
else
this.DC.UpdateEntity(this.Entity);
```
Contributor guide
Assessment
This issue has not been assessed yet.