Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save kellabyte/1823050 to your computer and use it in GitHub Desktop.

Select an option

Save kellabyte/1823050 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using Cassandraemon;
namespace CassandraGettingStartedSample
{
public class Post
{
public string user { get; set; }
public string text { get; set; }
}
class CassandraemonSample
{
public static void GetPosts()
{
Console.WriteLine("Getting posts with Cassandraemon...");
using (var context = new CassandraContext(
"127.0.0.1", 9160, "blog"))
{
CassandraEntity<List<Column>> last = null;
IQueryable<CassandraEntity<List<Column>>> entities;
var posts = (from x in context.ColumnList
where x.ColumnFamily == "posts" &&
x.Column == "user"
select x.ToObject<Post>()).Reverse();
foreach (var post in posts)
{
Console.WriteLine(string.Format(
"User: {0}\tText: {1}",
post.user,
post.text));
}
}
}
}
}
@vikramkone

Copy link
Copy Markdown

what are the 'last' and 'entities' variables for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment