public override List<ExplorerItem> GetSchemaAndBuildAssembly(IConnectionInfo connectionInfo, AssemblyName assemblyToBuild, ref string nameSpace, ref string typeName) { var properties = connectionInfo.GetConnectionProperties(); // using code from Microsoft's OData v4 Client Code Generator. see https://visualstudiogallery.msdn.microsoft.com/9b786c0e-79d1-4a50-89a5-125e57475937 var client = new ODataClient(new Configuration(properties.Uri, nameSpace, properties)); var code = client.GenerateCode(); // Compile the code into the assembly, using the assembly name provided: BuildAssembly(code, assemblyToBuild); var model = properties.GetModel(); typeName = GetContainerName(model); var schema = model.GetSchema(); return schema; }
public override List<ExplorerItem> GetSchemaAndBuildAssembly(IConnectionInfo cxInfo, AssemblyName assemblyToBuild, ref string nameSpace, ref string typeName) { // using code from Microsoft's OData v4 Client Code Generator. see https://visualstudiogallery.msdn.microsoft.com/9b786c0e-79d1-4a50-89a5-125e57475937 var client = new ODataClient(new Configuration(cxInfo.DatabaseInfo.Server, nameSpace)); var code = client.GenerateCode(); // Compile the code into the assembly, using the assembly name provided: var assembly = BuildAssembly(code, assemblyToBuild); typeName = GetContainerName(cxInfo); var containerName = string.Concat(nameSpace, ".", typeName); var containerType = assembly.GetType(containerName); // Use the schema to populate the Schema Explorer: var schema = GetSchema(containerType, assembly); return schema; }