CodeFirst自定义字段蛇形名称报错 返回

SqlSugar 沟通中
4 107

image.png

propertyInfo提示是menu表的Children字段,然后我是加了忽略了的

2f44c1e0-831c-43a2-abff-7c6c652cca85.png

然后报错是因为DbCloumnName是null

image.png

热忱回答4

  • image.png

    自个看一下这个行代码为什么报错。

    0 回复
  • 是不是空引用了。

    0 回复
  • @fate sta:对的,空引用了加了[SugarColumn(IsIgnore = true)]就会出现在这,DbCloumnName 是 null 

    我取消了Children的忽略Codefirst成功建表

    我又带着好奇新建了个字段添加忽略依然报这个错,需要我在写个判空吗

    image.pngimage.png

    0 回复
  • 加个If就行了ignore不转换。

    0 回复