当前位置: 首页>>代码示例>>C#>>正文


C# IContext.CreateClient方法代码示例

本文整理汇总了C#中IContext.CreateClient方法的典型用法代码示例。如果您正苦于以下问题:C# IContext.CreateClient方法的具体用法?C# IContext.CreateClient怎么用?C# IContext.CreateClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IContext的用法示例。


在下文中一共展示了IContext.CreateClient方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Hypertable

 public Hypertable(String host, String ns)
 {
     this.host = host;
     this.ns = ns;
     String conn = "Provider=Hyper;Uri=net.tcp://" + host;
     htContext = Context.Create(conn);
     htClient = htContext.CreateClient();
     htNs = htClient.OpenNamespace(ns, OpenDispositions.OpenAlways | OpenDispositions.CreateIntermediate);
 }
开发者ID:bwulff,项目名称:pg12-taipan-bridge,代码行数:9,代码来源:Hypertable.cs

示例2: ClassInitialize

        public static void ClassInitialize(Microsoft.VisualStudio.TestTools.UnitTesting.TestContext testContext)
        {
            const string Schema =
                "<Schema><AccessGroup name=\"default\" blksz=\"1024\">" +
                "<ColumnFamily><Name>a</Name></ColumnFamily>" +
                "<ColumnFamily><Name>b</Name></ColumnFamily>" +
                "<ColumnFamily><Name>c</Name></ColumnFamily>" +
                "</AccessGroup></Schema>";

            tableA = EnsureTable(typeof(TestMultipleInstances), Schema);

            var properties = new Dictionary<string, object> { { "Uri", UriB } };

            contextB = Hypertable.Context.Create(ConnectionString, properties);
            clientB = contextB.CreateClient();
            nsB = clientB.OpenNamespace(NsName, OpenDispositions.OpenAlways);
            nsB.DropTable(typeof(TestMultipleInstances).Name, DropDispositions.IfExists);
            nsB.CreateTable(typeof(TestMultipleInstances).Name, Schema);
            tableB = nsB.OpenTable(typeof(TestMultipleInstances).Name);
        }
开发者ID:andysoftdev,项目名称:ht4n,代码行数:20,代码来源:TestMultipleInstances.cs

示例3: FactoryContext

        /// <summary>
        /// Initializes a new instance of the <see cref="FactoryContext"/> class.
        /// </summary>
        /// <param name="configuration">
        /// The persistence configuration.
        /// </param>
        /// <param name="context">
        /// The database context.
        /// </param>
        /// <param name="disposeContext">
        /// Flag indicating whether this factory context owns the database context.
        /// </param>
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="configuration"/> is null.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// If <paramref name="context"/> is null.
        /// </exception>
        internal FactoryContext(PersistenceConfiguration configuration, IContext context, bool disposeContext)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            this.configuration = configuration;
            this.context = context;
            this.disposeContext = disposeContext;
            this.client = context.CreateClient();
        }
开发者ID:andysoftdev,项目名称:ht4o,代码行数:35,代码来源:FactoryContext.cs


注:本文中的IContext.CreateClient方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。