Example #1
0
        private static Action <object, object> createSourceSetter(Type oneSideType, Type manySideType)
        {
            var valueSetMethod = manySideType.GetProperties()
                                 .Single(p => MultiReference.IsReal(p) && MultiReference.SourceType(p) == oneSideType)
                                 .SetMethod;

            return(TableInfo.BuildSetAccessor(valueSetMethod));
        }
Example #2
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);
            }
        }