ServiceStack.OrmLite如何按属性忽略属性

ozz*_*ozz 9 orm servicestack

public class User
{
   public long Id {get;set;}

   [References(typeof(City))]
   public long CityId {get;set;}

   [????]
   public City {get;set;}
}
Run Code Online (Sandbox Code Playgroud)

我正在尝试使用ServiceStack.OrmLite.我正在使用ReferenceKey(CityId)和Reference(City).ReferenceKey用于创建Db,Reference用于在我的代码中使用对象.

ozz*_*ozz 15

IgnoreAttribute ..经测试,它的工作原理.

  • [忽略]是从OrmLite中忽略,[IgnoreDataMember]是从Serializer中忽略的 (4认同)