示例#1
0
        public override List <ExplorerItem> GetSchema(IConnectionInfo r, Type t)
        {
            List <ExplorerItem> schema = EntityFrameworkHelper.GetSchema(t);

            if ((from ei in schema
                 where ei.Kind == ExplorerItemKind.QueryableObject
                 select ei).All <ExplorerItem>(ei => ei.Children.Count == 0))
            {
                try
                {
                    ObjectContext objectContext = Activator.CreateInstance(t, this.GetContextConstructorArguments(r)) as ObjectContext;
                    if (objectContext != null)
                    {
                        return(EntityFrameworkEdmReader.GetSchema(objectContext));
                    }
                }
                catch
                {
                }
            }
            return(schema);
        }
示例#2
0
 public override List <ExplorerItem> GetSchema(IConnectionInfo cxInfo, Type t)
 {
     CheckEFAssemblyResolver(cxInfo);
     object[] contextConstructorArguments = this.GetContextConstructorArguments(cxInfo);
     return(EntityFrameworkEdmReader.GetSchema(GetObjectContext(Activator.CreateInstance(t, contextConstructorArguments))));
 }