示例#1
0
        public void Apply(IManyToOneInstance instance)
        {
            var field = instance.GetType().GetField("mapping", BindingFlags.Instance | BindingFlags.NonPublic);
            var impl  = field.GetValue(instance) as ManyToOneMapping;

            if (impl != null)
            {
                var attrField = typeof(ManyToOneMapping).GetField("attributes", BindingFlags.Instance | BindingFlags.NonPublic);
                var attrs     = attrField.GetValue(impl) as AttributeStore;
                if (attrs != null && attrs.Get("Lazy") != null)
                {
                    return;//Do not set lazy if was set elsewhere
                }
            }
            instance.LazyLoad();
        }