Example #1
0
        internal List<ExplorerItem> GetSchemaAndBuildAssembly(
            ConnectionProperties connectionProperties, 
            AssemblyName assemblyToBuild, 
            ref string nameSpace, 
            ref string typeName)
        {
            var simpleName = Path.GetFileNameWithoutExtension(assemblyToBuild.CodeBase);
            var module = new DynamicModule(simpleName, allowSave: true, saveDirectory: Path.GetDirectoryName(assemblyToBuild.CodeBase));
            var model = ODataClientContextBase.LoadModelFromService(new Uri(connectionProperties.Uri + "/$metadata"));
            var factory = new ODataClientContextFactory(module);

            var generatedType = factory.ImplementClientContext(model);

            nameSpace = generatedType.Namespace;
            typeName = generatedType.Name;

            module.SaveAssembly();

            return BuildSchema(model);
        }
 //-----------------------------------------------------------------------------------------------------------------------------------------------------
 public ConnectionDialog(IConnectionInfo connectionInfo)
 {
     DataContext = _properties = new ConnectionProperties(connectionInfo);
     Background = SystemColors.ControlBrush;
     InitializeComponent();
 }