private static bool IsCompositeResolver(IDbDependencyResolver resolver) { var type = resolver.GetType(); return(type.IsGenericType && type.GetGenericTypeDefinition().FullName == @"System.Data.Entity.Infrastructure.DependencyResolution.CompositeResolver`2"); }
private static IEnumerable <IDbDependencyResolver> ExplodeResolverChain( IDbDependencyResolver resolverChain) { var type = resolverChain.GetType(); var resolvers = (IEnumerable <IDbDependencyResolver>)type.GetProperty(@"Resolvers").GetValue(resolverChain, null); return(resolvers.SelectMany(GetInternalResolvers)); }
private static IEnumerable <IDbDependencyResolver> ExplodeCompositeResolver( IDbDependencyResolver compositeResolver) { var type = compositeResolver.GetType(); var first = (IDbDependencyResolver)type.GetProperty("First").GetValue(compositeResolver, null); var second = (IDbDependencyResolver)type.GetProperty("Second").GetValue(compositeResolver, null); return(GetInternalResolvers(first) .Concat(GetInternalResolvers(second))); }
private static bool IsRootDependencyResolver(IDbDependencyResolver resolver) { return(resolver.GetType() .FullName .Equals(@"System.Data.Entity.Infrastructure.DependencyResolution.RootDependencyResolver")); }