Skip to content

Instantly share code, notes, and snippets.

@PureKrome
Created May 19, 2013 12:37
Show Gist options
  • Save PureKrome/5607527 to your computer and use it in GitHub Desktop.
Save PureKrome/5607527 to your computer and use it in GitHub Desktop.
PLaying around with RavenDb and sessions.
using System;
using System.Linq;
using Raven.Client.Document;
namespace ConsoleApplication7
{
internal class Program
{
private static void Main(string[] args)
{
var documentStore = new DocumentStore
{
Url = "http://localhost:8080",
DefaultDatabase = "abcdefg"
};
documentStore.Initialize();
using (var session = documentStore.OpenSession())
{
session.Store(new Foo
{
Name = "fred"
});
var x = session.Query<Foo>().ToList();
// Count is 0, not 1.
Console.WriteLine(x.Count);
}
documentStore.Dispose();
}
}
public class Foo
{
public string Id { get; set; }
public string Name { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment