本文整理汇总了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);
}
示例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);
}
示例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();
}