Example #1
0
        private static bool IsCompositeResolver(IDbDependencyResolver resolver)
        {
            var type = resolver.GetType();

            return(type.IsGenericType &&
                   type.GetGenericTypeDefinition().FullName == @"System.Data.Entity.Infrastructure.DependencyResolution.CompositeResolver`2");
        }
Example #2
0
        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));
        }
Example #3
0
        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)));
        }
Example #4
0
 private static bool IsRootDependencyResolver(IDbDependencyResolver resolver)
 {
     return(resolver.GetType()
            .FullName
            .Equals(@"System.Data.Entity.Infrastructure.DependencyResolution.RootDependencyResolver"));
 }