本文整理汇总了C#中CassandraContext类的典型用法代码示例。如果您正苦于以下问题:C# CassandraContext类的具体用法?C# CassandraContext怎么用?C# CassandraContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CassandraContext类属于命名空间,在下文中一共展示了CassandraContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateComments
private static void CreateComments()
{
using (var db = new CassandraContext(keyspace: keyspaceName, server: server))
{
var key = "first-blog-post";
// get the comments family
var commentsFamily = db.GetColumnFamily<TimeUUIDType, UTF8Type>("Comments");
ConsoleHeader("create comments");
dynamic postComments = commentsFamily.CreateRecord(key: key);
// lets attach it to the database before we add the comments
db.Attach(postComments);
// add 5 comments
for (int i = 0; i < 5; i++)
{
dynamic comment = postComments.CreateSuperColumn();
comment.Name = "Nick Berardi";
comment.Email = "[email protected]";
comment.Website = "www.coderjournal.com";
comment.Comment = "Wow fluent cassandra is really great and easy to use.";
var commentPostedOn = DateTime.Now;
postComments[commentPostedOn] = comment;
Console.WriteLine("Comment " + (i + 1) + " Posted On " + commentPostedOn.ToLongTimeString());
Thread.Sleep(TimeSpan.FromSeconds(2));
}
// save the comments
db.SaveChanges();
}
}
开发者ID:DerekLiang,项目名称:fluentcassandra,代码行数:35,代码来源:Program.cs
示例2: CreateColumnFamilyWithTimestampOperator
private static void CreateColumnFamilyWithTimestampOperator()
{
using (var db = new CassandraContext(keyspace: KeyspaceName, server: Server))
{
db.ExecuteNonQuery("CREATE TABLE TestCF2 (KEY text PRIMARY KEY) WITH comparator=timestamp AND default_validation=text;");
DateTimeOffset UnixStart = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);
DateTimeOffset TimeNow = DateTimeOffset.UtcNow;
var columnName2 = Convert.ToInt64(Math.Floor((TimeNow - UnixStart).TotalMilliseconds));
var columnName1 = columnName2 + 5000;
db.ExecuteNonQuery(string.Format("INSERT INTO TestCF2 (KEY, {0}, {1}) VALUES ('Key1', 'Value1', 'Value2')", columnName1, columnName2));
List<ICqlRow> rows = db.ExecuteQuery("SELECT * FROM TestCF2 WHERE KEY = 'Key1'").ToList();
DateTime value1 = rows[0].Columns[1].ColumnName.GetValue<DateTime>();
DateTime value2 = rows[0].Columns[2].ColumnName.GetValue<DateTime>();
ConsoleHeader("Returned data from db for timestamp comparator");
ConsoleHeader(value1.ToString());
ConsoleHeader(value2.ToString());
}
}
开发者ID:nativex,项目名称:fluentcassandra,代码行数:26,代码来源:Program.cs
示例3: BigDecimalTest
private static void BigDecimalTest()
{
using (var db = new CassandraContext(keyspace: KeyspaceName, server: Server))
{
// arrange
db.ExecuteNonQuery("CREATE TABLE OfferReservation2 (KEY text PRIMARY KEY) WITH comparator = text AND default_validation = decimal");
db.ExecuteNonQuery("INSERT INTO OfferReservation2 (KEY, 'MyColumn') VALUES ('Key0', 1000000000000000000)");
db.ExecuteNonQuery("INSERT INTO OfferReservation2 (KEY, 'MyColumn') VALUES ('Key1', 0.25)");
db.ExecuteNonQuery("INSERT INTO OfferReservation2 (KEY, 'MyColumn') VALUES ('Key2', 2000000000000.1234)");
db.ExecuteNonQuery("INSERT INTO OfferReservation2 (KEY, 'MyColumn') VALUES ('Key3', -0.25)");
db.ExecuteNonQuery("INSERT INTO OfferReservation2 (KEY, 'MyColumn') VALUES ('Key4', -0.25122333)");
var actual = db.ExecuteQuery("SELECT * FROM OfferReservation2");
var results = actual.ToList();
var firstValue = (decimal)results.First(x => x.Key == "Key0")["MyColumn"];
var secondValue = (decimal)results.First(x => x.Key == "Key1")["MyColumn"];
var thirdValue = (decimal)results.First(x => x.Key == "Key2")["MyColumn"];
var fourthValue = (decimal)results.First(x => x.Key == "Key3")["MyColumn"];
var fifthValue = (decimal)results.First(x => x.Key == "Key4")["MyColumn"];
ConsoleHeader("Returned data from Big Decimal Test");
ConsoleHeader(firstValue.ToString());
ConsoleHeader(secondValue.ToString());
ConsoleHeader(thirdValue.ToString());
ConsoleHeader(fourthValue.ToString());
ConsoleHeader(fifthValue.ToString());
}
}
开发者ID:nativex,项目名称:fluentcassandra,代码行数:31,代码来源:Program.cs
示例4: DoWork
private static void DoWork()
{
using (var db = new CassandraContext(keyspace: keyspaceName, server: server))
{
Stopwatch watch = new Stopwatch();
watch.Start();
Random random = new Random();
byte[] data = new byte[dataLength];
random.NextBytes(data);
int errors = 0;
for (int i = 0; i < count; i++)
{
// Insert
Guid postId = Guid.NewGuid();
string titleName = i.ToString();
var family = db.GetColumnFamily<UTF8Type, UTF8Type>("Posts");
dynamic post = family.CreateRecord(postId);
dynamic details = post.CreateSuperColumn();
details.Body = data;
post[DateTime.Now] = details;
db.Attach(post);
db.SaveChanges();
}
double rate = count / watch.Elapsed.TotalSeconds;
double throughput = rate * data.Length;
Console.WriteLine("Completed: " + watch.Elapsed + "\tRate: " + rate + "\tThroughput: " + throughput + "\tErrors:" + errors);
}
}
开发者ID:brooklynDev,项目名称:fluentcassandra,代码行数:35,代码来源:Program.cs
示例5: ResetDatabase
public void ResetDatabase()
{
using (var session = new CassandraSession(ConnectionBuilder))
using (var db = new CassandraContext(session))
{
db.ThrowErrors = true;
db.TryDropKeyspace(Keyspace);
var keyspace = new CassandraKeyspace(new CassandraKeyspaceSchema
{
Name = Keyspace
}, db);
db.Keyspace = keyspace;
keyspace.TryCreateSelf();
db.ExecuteNonQuery(@"
CREATE TABLE users (
id int ,
name ascii,
email ascii,
age int,
PRIMARY KEY(id, email)
);");
ResetUsersFamily(db);
}
}
开发者ID:smerchek,项目名称:fluentcassandra,代码行数:28,代码来源:CassandraCql3DatabaseSetup.cs
示例6: CompatibilityCassandraDatabaseSetup
public CompatibilityCassandraDatabaseSetup(bool reset = false, bool toLower = false, bool toLower2 = false)
{
this.toLower = toLower;
this.toLower2 = toLower2;
ConnectionBuilder = new ConnectionBuilder(keyspace: Keyspace, server: Server, cqlVersion: CqlVersion.Cql3);
DB = new CassandraContext(ConnectionBuilder);
if (DB.KeyspaceExists(Keyspace))
DB.DropKeyspace(Keyspace);
var keyspace = new CassandraKeyspace(new CassandraKeyspaceSchema
{
Name = Keyspace,
}, DB);
var exists = DB.KeyspaceExists(Keyspace);
if(!exists)
keyspace.TryCreateSelf();
Family = DB.GetColumnFamily<AsciiType>("Standard");
SuperFamily = DB.GetColumnFamily<AsciiType, AsciiType>("Super");
UserFamily = DB.GetColumnFamily(toLowerIf(toLower,"Users"));
if (exists && !reset)
return;
ResetDatabase();
}
开发者ID:smerchek,项目名称:fluentcassandra,代码行数:29,代码来源:CompatibilityCassandraDatabaseSetup.cs
示例7: CreateFirstPost
private static void CreateFirstPost()
{
using (var db = new CassandraContext(keyspace: KeyspaceName, server: Server))
{
var key = "first-blog-post";
var postFamily = db.GetColumnFamily("Posts");
var tagsFamily = db.GetColumnFamily("Tags");
// create post
ConsoleHeader("create post");
dynamic post = postFamily.CreateRecord(key: key);
post.Title = "My First Cassandra Post";
post.Body = "Blah. Blah. Blah. about my first post on how great Cassandra is to work with.";
post.Author = "Nick Berardi";
post.PostedOn = DateTimeOffset.Now;
// create tags
ConsoleHeader("create post tags");
dynamic tags = tagsFamily.CreateRecord(key: key);
tags[0] = "Cassandra";
tags[1] = ".NET";
tags[2] = "Database";
tags[3] = "NoSQL";
// attach the post to the database
ConsoleHeader("attaching record");
db.Attach(post);
db.Attach(tags);
// save the changes
ConsoleHeader("saving changes");
db.SaveChanges();
}
}
开发者ID:shawnbissell,项目名称:fluentcassandra,代码行数:35,代码来源:Program.cs
示例8: LinqToCqlObjectsTests
public LinqToCqlObjectsTests()
{
var keyspaceName = ConfigurationManager.AppSettings["TestKeySpace"];
var server = new Server(ConfigurationManager.AppSettings["TestServer"]);
_db = new CassandraContext(keyspace: keyspaceName, server: server);
_family = _db.GetColumnFamily<AsciiType>("Users");
}
开发者ID:smerchek,项目名称:fluentcassandra,代码行数:8,代码来源:LinqToCqlObjectsTests.cs
示例9: LinqToCqlTests
public LinqToCqlTests()
{
var keyspaceName = ConfigurationManager.AppSettings["TestKeySpace"];
var server = new Server(ConfigurationManager.AppSettings["TestServer"]);
_db = new CassandraContext(new ConnectionBuilder(keyspace: keyspaceName, server: server, cqlVersion: CqlVersion.Cql));
_family = _db.GetColumnFamily<AsciiType>("Users");
}
开发者ID:achinn,项目名称:fluentcassandra,代码行数:8,代码来源:LinqToCqlTests.cs
示例10: LinqToCqlObjectsTests
public LinqToCqlObjectsTests()
{
var keyspaceName = "Testing";
var server = new Server("localhost");
_db = new CassandraContext(keyspace: keyspaceName, server: server);
_family = _db.GetColumnFamily<AsciiType>("Users");
}
开发者ID:rsparkyc,项目名称:fluentcassandra,代码行数:8,代码来源:LinqToCqlObjectsTests.cs
示例11: ResetDatabase
public void ResetDatabase()
{
using (var session = new CassandraSession(ConnectionBuilder))
using (var db = new CassandraContext(session))
{
db.ThrowErrors = true;
db.TryDropKeyspace(Keyspace);
var keyspace = new CassandraKeyspace(new CassandraKeyspaceSchema
{
Name = Keyspace
}, db);
db.Keyspace = keyspace;
keyspace.TryCreateSelf();
keyspace.TryCreateColumnFamily<AsciiType>("Standard");
keyspace.TryCreateColumnFamily<AsciiType, AsciiType>("Super");
keyspace.TryCreateColumnFamily<AsciiType>("StandardAsciiType");
keyspace.TryCreateColumnFamily<BytesType>("StandardBytesType");
keyspace.TryCreateColumnFamily<IntegerType>("StandardIntegerType");
keyspace.TryCreateColumnFamily<LexicalUUIDType>("StandardLexicalUUIDType");
keyspace.TryCreateColumnFamily<LongType>("StandardLongType");
keyspace.TryCreateColumnFamily<TimeUUIDType>("StandardTimeUUIDType");
keyspace.TryCreateColumnFamily<UTF8Type>("StandardUTF8Type");
keyspace.TryCreateColumnFamily<UUIDType>("StandardUUIDType");
keyspace.TryCreateColumnFamily(new CassandraColumnFamilySchema
{
FamilyName = "StandardCompositeType",
ColumnNameType = CassandraType.CompositeType(new[] { CassandraType.AsciiType, CassandraType.DoubleType })
});
keyspace.TryCreateColumnFamily(new CassandraColumnFamilySchema
{
FamilyName = "StandardDynamicCompositeType",
ColumnNameType = CassandraType.DynamicCompositeType(new Dictionary<char, CassandraType> { { 'a', CassandraType.AsciiType }, { 'd', CassandraType.DoubleType } })
});
db.ExecuteNonQuery(string.Format(@"
CREATE TABLE {0} (
id int ,
name ascii,
email ascii,
age int,
PRIMARY KEY(id)
);", toLowerIf(toLower, "Users")));
//db.ExecuteNonQuery(@"CREATE INDEX User_Age ON users (Age);");
db.Keyspace.ClearCachedKeyspaceSchema();
var family = db.GetColumnFamily<AsciiType>("Standard");
var superFamily = db.GetColumnFamily<AsciiType, AsciiType>("Super");
var userFamily = db.GetColumnFamily(toLowerIf(toLower, "Users"));
ResetFamily(family);
ResetSuperFamily(superFamily);
ResetUsersFamily(userFamily);
}
}
开发者ID:smerchek,项目名称:fluentcassandra,代码行数:57,代码来源:CompatibilityCassandraDatabaseSetup.cs
示例12: ResetDatabase
public void ResetDatabase()
{
using (var session = new CassandraSession(ConnectionBuilder))
using (var db = new CassandraContext(session))
{
db.ThrowErrors = true;
try { db.DropKeyspace(Keyspace); }
catch (Exception exc) { Console.WriteLine(exc); }
var keyspace = new CassandraKeyspace(new CassandraKeyspaceSchema {
Name = Keyspace
}, db);
db.Keyspace = keyspace;
keyspace.TryCreateSelf();
keyspace.TryCreateColumnFamily<AsciiType>("Standard");
keyspace.TryCreateColumnFamily<AsciiType, AsciiType>("Super");
keyspace.TryCreateColumnFamily<AsciiType>("StandardAsciiType");
keyspace.TryCreateColumnFamily<BytesType>("StandardBytesType");
keyspace.TryCreateColumnFamily<IntegerType>("StandardIntegerType");
keyspace.TryCreateColumnFamily<LexicalUUIDType>("StandardLexicalUUIDType");
keyspace.TryCreateColumnFamily<LongType>("StandardLongType");
keyspace.TryCreateColumnFamily<TimeUUIDType>("StandardTimeUUIDType");
keyspace.TryCreateColumnFamily<UTF8Type>("StandardUTF8Type");
keyspace.TryCreateColumnFamily<UUIDType>("StandardUUIDType");
keyspace.TryCreateColumnFamily(new CassandraColumnFamilySchema {
FamilyName = "StandardCompositeType",
ColumnNameType = CassandraType.CompositeType(new[] { CassandraType.AsciiType, CassandraType.DoubleType })
});
keyspace.TryCreateColumnFamily(new CassandraColumnFamilySchema {
FamilyName = "StandardDynamicCompositeType",
ColumnNameType = CassandraType.DynamicCompositeType(new Dictionary<char, CassandraType> { { 'a', CassandraType.AsciiType }, { 'd', CassandraType.DoubleType } })
});
db.ExecuteNonQuery(@"
CREATE COLUMNFAMILY Users (
KEY int PRIMARY KEY,
Name ascii,
Email ascii,
Age int
);");
db.ExecuteNonQuery(@"CREATE INDEX User_Age ON Users (Age);");
db.Keyspace.ClearCachedKeyspaceSchema();
var family = db.GetColumnFamily<AsciiType>("Standard");
var superFamily = db.GetColumnFamily<AsciiType, AsciiType>("Super");
var userFamily = db.GetColumnFamily("Users");
ResetFamily(family);
ResetSuperFamily(superFamily);
ResetUsersFamily(userFamily);
}
}
开发者ID:shawnbissell,项目名称:fluentcassandra,代码行数:54,代码来源:CassandraDatabaseSetup.cs
示例13: CreateRecord_Doesnt_Check_BytesType_Zero_Length
public void CreateRecord_Doesnt_Check_BytesType_Zero_Length()
{
// arrange
var db = new CassandraContext("Test1", "localhost");
var family = db.GetColumnFamily<AsciiType>(FamilyName);
// act
// assert
Assert.Throws<ArgumentException>(delegate {
dynamic value = family.CreateRecord("");
});
}
开发者ID:achinn,项目名称:fluentcassandra,代码行数:12,代码来源:ReportedIssuesTests.cs
示例14: _CassandraSetup
public _CassandraSetup()
{
var keyspaceName = "Testing";
var server = new Server("localhost");
if (CassandraSession.KeyspaceExists(server, keyspaceName))
CassandraSession.DropKeyspace(server, keyspaceName);
var keyspace = new CassandraKeyspace(keyspaceName);
keyspace.TryCreateSelf(server);
keyspace.TryCreateColumnFamily<AsciiType>(server, "Standard");
keyspace.TryCreateColumnFamily<AsciiType, AsciiType>(server, "Super");
keyspace.TryCreateColumnFamily<AsciiType>(server, "StandardAsciiType");
keyspace.TryCreateColumnFamily<BytesType>(server, "StandardBytesType");
keyspace.TryCreateColumnFamily<IntegerType>(server, "StandardIntegerType");
keyspace.TryCreateColumnFamily<LexicalUUIDType>(server, "StandardLexicalUUIDType");
keyspace.TryCreateColumnFamily<LongType>(server, "StandardLongType");
keyspace.TryCreateColumnFamily<TimeUUIDType>(server, "StandardTimeUUIDType");
keyspace.TryCreateColumnFamily<UTF8Type>(server, "StandardUTF8Type");
keyspace.TryCreateColumnFamily<UUIDType>(server, "StandardUUIDType");
keyspace.TryCreateColumnFamily<CompositeType<LongType, UTF8Type>>(server, "StandardCompositeType");
keyspace.TryCreateColumnFamily<DynamicCompositeType>(server, "StandardDynamicCompositeType");
DB = new CassandraContext(keyspaceName, server);
DB.ThrowErrors = true;
Family = DB.GetColumnFamily<AsciiType>("Standard");
SuperFamily = DB.GetColumnFamily<AsciiType, AsciiType>("Super");
Family.RemoveAllRows();
SuperFamily.RemoveAllRows();
Family.InsertColumn(TestKey1, "Test1", Math.PI);
Family.InsertColumn(TestKey1, "Test2", Math.PI);
Family.InsertColumn(TestKey1, "Test3", Math.PI);
SuperFamily.InsertColumn(TestKey1, TestSuperName, "Test1", Math.PI);
SuperFamily.InsertColumn(TestKey1, TestSuperName, "Test2", Math.PI);
SuperFamily.InsertColumn(TestKey1, TestSuperName, "Test3", Math.PI);
Family.InsertColumn(TestKey2, "Test1", Math.PI);
Family.InsertColumn(TestKey2, "Test2", Math.PI);
Family.InsertColumn(TestKey2, "Test3", Math.PI);
SuperFamily.InsertColumn(TestKey2, TestSuperName, "Test1", Math.PI);
SuperFamily.InsertColumn(TestKey2, TestSuperName, "Test2", Math.PI);
SuperFamily.InsertColumn(TestKey2, TestSuperName, "Test3", Math.PI);
}
开发者ID:brooklynDev,项目名称:fluentcassandra,代码行数:48,代码来源:_CassandraSetup.cs
示例15: CassandraDatabaseSetup
public CassandraDatabaseSetup(bool reset = false)
{
ConnectionBuilder = new ConnectionBuilder(keyspace: Keyspace, server: Server);
DB = new CassandraContext(ConnectionBuilder);
var exists = DB.KeyspaceExists(Keyspace);
Family = DB.GetColumnFamily<AsciiType>("Standard");
SuperFamily = DB.GetColumnFamily<AsciiType, AsciiType>("Super");
UserFamily = DB.GetColumnFamily("Users");
if (exists && !reset)
return;
ResetDatabase();
}
开发者ID:juanbucz,项目名称:fluentcassandra,代码行数:16,代码来源:CassandraDatabaseSetup.cs
示例16: SetupKeyspace
private static void SetupKeyspace()
{
using (var db = new CassandraContext(keyspace: KeyspaceName, server: Server))
{
if (db.KeyspaceExists(KeyspaceName))
db.DropKeyspace(KeyspaceName);
var keyspace = new CassandraKeyspace(new CassandraKeyspaceSchema
{
Name = KeyspaceName,
}, db);
keyspace.TryCreateSelf();
// create column family using CQL
db.ExecuteNonQuery(@"
CREATE COLUMNFAMILY Posts (
KEY ascii PRIMARY KEY,
Title text,
Body text,
Author text,
PostedOn timestamp
);");
// create column family using API
keyspace.TryCreateColumnFamily(new CassandraColumnFamilySchema
{
FamilyName = "Tags",
KeyValueType = CassandraType.AsciiType,
ColumnNameType = CassandraType.Int32Type,
DefaultColumnValueType = CassandraType.UTF8Type
});
// create super column family using API
keyspace.TryCreateColumnFamily(new CassandraColumnFamilySchema
{
FamilyName = "Comments",
FamilyType = ColumnType.Super,
KeyValueType = CassandraType.AsciiType,
SuperColumnNameType = CassandraType.DateType,
ColumnNameType = CassandraType.UTF8Type,
DefaultColumnValueType = CassandraType.UTF8Type
});
}
}
开发者ID:achinn,项目名称:fluentcassandra,代码行数:45,代码来源:Program.cs
示例17: ResetDatabase
public void ResetDatabase()
{
using (var session = new CassandraSession(ConnectionBuilder))
using (var db = new CassandraContext(session))
{
db.ThrowErrors = true;
db.TryDropKeyspace(Keyspace);
var keyspace = new CassandraKeyspace(new CassandraKeyspaceSchema
{
Name = Keyspace
}, db);
db.Keyspace = keyspace;
keyspace.TryCreateSelf();
}
}
开发者ID:smerchek,项目名称:fluentcassandra,代码行数:18,代码来源:GenericDatabaseSetup.cs
示例18: CreateTablesIfNotExists
public static void CreateTablesIfNotExists(CassandraContext db)
{
try
{
db.ExecuteNonQuery(string.Format(@"
CREATE TABLE {0} (
id uuid,
logic text,
command text,
hidden_till timestamp,
PRIMARY KEY (id));
", TableName("main")));
}
catch (CassandraException) { }
try
{
db.ExecuteNonQuery(string.Format(@"
CREATE TABLE {0} (
id uuid,
oid uuid,
progress double,
last_access timestamp,
PRIMARY KEY (id,oid));
", TableName("trans")));
}
catch (CassandraException) { }
try
{
db.ExecuteNonQuery(string.Format(@"
CREATE TABLE {0} (
id uuid,
oid uuid,
what int,
when timestamp,
info text,
PRIMARY KEY (id,oid,what,when));
", TableName("out")));
}
catch (CassandraException) { }
}
开发者ID:nativex,项目名称:fluentcassandra,代码行数:41,代码来源:StressTest2.cs
示例19: Init
public void Init()
{
_context = new CassandraContext(keyspace: DummiesKeySpace, host: "localhost");
if (!_context.KeyspaceExists(DummiesKeySpace))
{
var keyspace = new CassandraKeyspace(new CassandraKeyspaceSchema
{
Name = DummiesKeySpace,
}, _context);
keyspace.TryCreateSelf();
_context.ExecuteQuery(
@"
CREATE COLUMNFAMILY Dummies (
KEY ascii PRIMARY KEY,
Blob blob
);");
_context.SaveChanges();
}
_dummies = _context.GetColumnFamily("Dummies");
}
开发者ID:aliostad,项目名称:NoSqlBenchmarking,代码行数:21,代码来源:CassandraBenchmark.cs
示例20: CreateComments
private static void CreateComments()
{
using (var db = new CassandraContext(keyspace: KeyspaceName, server: Server))
{
var key = "first-blog-post";
// get the comments family
var commentsFamily = db.GetSuperColumnFamily("Comments");
ConsoleHeader("create comments");
var postComments = commentsFamily.CreateRecord(key: key);
// lets attach it to the database before we add the comments
db.Attach(postComments);
var dt = new DateTime(2010, 11, 29, 5, 03, 00, DateTimeKind.Local);
// add 5 comments
for (int i = 0; i < 5; i++)
{
var comment = postComments.CreateSuperColumn();
comment["Name"] = "Nick Berardi";
comment["Email"] = "[email protected]";
// you can also use it as a dynamic object
dynamic dcomment = comment;
dcomment.Website = "www.coderjournal.com";
dcomment.Comment = "Wow fluent cassandra is really great and easy to use.";
var commentPostedOn = dt;
postComments[commentPostedOn] = comment;
Console.WriteLine("Comment " + (i + 1) + " Posted On " + commentPostedOn.ToLongTimeString());
dt = dt.AddMinutes(2);
}
// save the comments
db.SaveChanges();
}
}
开发者ID:rsparkyc,项目名称:fluentcassandra,代码行数:40,代码来源:Program.cs
注:本文中的CassandraContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论