Aetheria/Assets/Scripts/ServerShared/NIH/RethinkDb/RethinkDb.Driver.Linq/LinqExtensions.cs
Reinier Vens 48759380c5 Slime Stuff & DB Prep
Put the finishing touches on the microfauna
Prepared the repository for database extraction
2021-03-30 01:17:58 +01:00

26 lines
810 B
C#

using Remotion.Linq;
using Remotion.Linq.Parsing.Structure;
using RethinkDb.Driver.Ast;
using RethinkDb.Driver.Net;
namespace RethinkDb.Driver.Linq
{
public static class LinqExtensions
{
public static RethinkQueryable<T> AsQueryable<T>( this Table term, IConnection conn )
{
var executor = new RethinkQueryExecutor( term, conn );
return new RethinkQueryable<T>(
new DefaultQueryProvider(
typeof( RethinkQueryable<> ),
QueryParser.CreateDefault(),
executor )
);
}
public static RethinkQueryable<T> Table<T>( this Db db, string tableName, IConnection conn )
{
return db.Table( tableName ).AsQueryable<T>( conn );
}
}
}