-
-
Notifications
You must be signed in to change notification settings - Fork 131
LINQ to ReQL Provider
Brian Chavez edited this page May 13, 2016
·
36 revisions
The C# driver offers an experimental LINQ to ReQL driver for those who are looking for a more idiomatic .NET experience when working with RethinkDB. Here's a quick example:
var games = new[]
{
new Game {id = 2, Player = "Bob", Points = 15, Type = "ranked"},
new Game {id = 5, Player = "Alice", Points = 7, Type = "free"},
new Game {id = 11, Player = "Bob", Points = 10, Type = "free"},
new Game {id = 12, Player = "Alice", Points = 2, Type = "free"},
};
// LINQ to ReQL
var results = R.Db("lobby").Table<Game>("games", conn)
.Where(g => g.Player == "Alice" && g.Points > 5)
.ToList();
results.Dump();
/* OUTPUT:
[
{
"id": 5,
"Player": "Alice",
"Points": 7,
"Type": "free"
}
]
*/
NuGet Package RethinkDb.Driver.Linq
Install-Package RethinkDb.Driver.Linq -Pre
- Home
- Query Examples
- Logging
- Connections & Pooling
- Extra C# Features
- GOTCHA Goblins!
- LINQ to ReQL Provider
- Differences
- Java ReQL API Documentation