Permalink
Browse files

added new 'get' and 'all' to console app

  • Loading branch information...
1 parent b648c38 commit 02476feeff51ae3d64d7c8b3e3275cf5ba6182e0 @phillip-haydon committed Oct 3, 2012
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using Raven.Client.Document;
namespace Raven.DynamicSession.TestConsole
@@ -15,6 +16,8 @@ static void Main(string[] args)
using (dynamic session = documentStore.OpenDynamicSession())
{
+ Console.WriteLine("----- insert tests");
+
session.Posts.insert(new
{
Name = "Rabbit"
@@ -37,6 +40,26 @@ static void Main(string[] args)
using (dynamic session = documentStore.OpenDynamicSession())
{
+ Console.WriteLine("----- all tests");
+
+ IEnumerable<dynamic> posts = session.Posts.all();
+ IEnumerable<dynamic> people = session.People.all();
+
+ foreach (var post in posts)
+ {
+ Console.WriteLine(post.Name);
+ }
+
+ foreach (var person in people)
+ {
+ Console.WriteLine(person.FirstName);
+ }
+ }
+
+ using (dynamic session = documentStore.OpenDynamicSession())
+ {
+ Console.WriteLine("----- load tests");
+
dynamic post1 = session.Posts.load(123);
Console.WriteLine(post1.Name);
@@ -50,6 +73,23 @@ static void Main(string[] args)
Console.WriteLine(person2.FirstName);
}
+ using (dynamic session = documentStore.OpenDynamicSession())
+ {
+ Console.WriteLine("----- get tests");
+
+ dynamic post1 = session.Posts.gET(123);
+ Console.WriteLine(post1.Name);
+
+ dynamic post2 = session.Posts.get(909);
+ Console.WriteLine(post2.Name);
+
+ dynamic person1 = session.People.GET(1);
+ Console.WriteLine(person1.FirstName);
+
+ dynamic person2 = session.People.Get(2);
+ Console.WriteLine(person2.FirstName);
+ }
+
Console.ReadKey();
}
}
@@ -57,7 +57,9 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
- <None Include="packages.config" />
+ <None Include="packages.config">
+ <SubType>Designer</SubType>
+ </None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Raven.DynamicSession\Raven.DynamicSession.csproj">

0 comments on commit 02476fe

Please sign in to comment.