错误:Non-static method requires a target. 返回
想弄一个保存返回实体于是就报错了:


热忱回答(5)
-
fate stay night VIP0
2021/9/17提供实体类
0 回复 -
liftlei VIP0
2021/9/17@fate stay night:
[SugarTable("customer")]
public class Customer
{
#region 通用属性
[SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
public int Id { get; set; }
public DateTime CreateTime { get; set; }
public int CompanyId { get; set; }
public string LoginName { get; set; }
[JsonIgnore]
public string LastChange { get; set; }
public OrderQueryConditionField OrderQueryConditionField { get; set; }
#endregion
#region 导航属性
[JsonIgnore]
[SugarColumn(IsIgnore = true)]
public List<CustomerRole> CustomerRoles { get; set; }
[SugarColumn(IsIgnore = true)]
public int[] RoleIds => CustomerRoles?.GroupBy(g => g.RoleId).Select(t => t.Key).ToArray();
#endregion
}
0 回复 -
fate stay night VIP0
2021/9/17public OrderQueryConditionField OrderQueryConditionField { get; set; } 这个对象有问题吧 ,你没加Ignore特性
0 回复 -
liftlei VIP0
2021/9/18@fate stay night:这是 enum 表里是有这个字段的
0 回复 -
fate stay night VIP0
2021/9/18@liftlei:提供可以重现的用例吧
0 回复