示例#1
0
 internal ITable getSourceTable(PropertyInfo prop)
 {
     if (sourceTables == null)
     {
         sourceTables = ReferenceSources.ToDictionary(s => s, s => db.GetTable(s.PropertyType.GetGenericArguments()[0]));
     }
     return(sourceTables[prop]);
 }
示例#2
0
 public ForeignKeyReader(FastDatabase db, Type referencedType)
 {
     this.db         = db;
     referencedTable = db.GetTable(referencedType);
     if (referencedTable == null)
     {
         referencedTable = new EmptyTable <Entity>();
     }
     Type = referencedType;
 }
示例#3
0
        public MultiKeyReader(FastDatabase db)
        {
            this.db         = db;
            referencedTable = db.GetTable(typeof(TSource));
            this.Type       = typeof(TSource);

            var postSetProp = typeof(TSource).GetProperties().SingleOrDefault(p => ForeignKey.Is(p) && ForeignKey.IsPostSet(p));

            if (postSetProp != null)
            {
                postSetter = TableInfo.BuildSetAccessor(postSetProp.SetMethod);
            }
        }