private static void SetResetFKSetterFlagDelegate( Type proxyType, EntityProxyTypeInfo proxyTypeInfo) { FieldInfo field = proxyType.GetField("_resetFKSetterFlag", BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.NonPublic); EntityProxyFactory.AssignInterceptionDelegate((Delegate)EntityProxyFactory.GetResetFKSetterFlagDelegate(proxyTypeInfo.EntityWrapperDelegate), field); }
private static void InterceptMember( EdmMember member, Type proxyType, EntityProxyTypeInfo proxyTypeInfo) { PropertyInfo topProperty = proxyType.GetTopProperty(member.Name); FieldInfo field = proxyType.GetField(LazyLoadImplementor.GetInterceptorFieldName(member.Name), BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.NonPublic); EntityProxyFactory.AssignInterceptionDelegate(EntityProxyFactory.GetInterceptorDelegateMethod.MakeGenericMethod(proxyType, topProperty.PropertyType).Invoke((object)null, new object[2] { (object)member, (object)proxyTypeInfo.EntityWrapperDelegate }) as Delegate, field); }
private static void SetCompareByteArraysDelegate(Type proxyType) { FieldInfo field = proxyType.GetField("_compareByteArrays", BindingFlags.DeclaredOnly | BindingFlags.Static | BindingFlags.NonPublic); EntityProxyFactory.AssignInterceptionDelegate((Delegate) new Func <object, object, bool>(ByValueEqualityComparer.Default.Equals), field); }