custom linq providers

Post on 21-May-2015

878 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

The presentation how to create custom linq providers for .net

TRANSCRIPT

IQUERY

PROVIDER

source

.Provider

.Execute<int>(

Expression.Call(null,

((MethodInfo) MethodBase

.GetCurrentMethod())

.MakeGenericMethod(

new Type[] {

typeof(TSource) }),

new Expression[] {source.Expression }));

Source

.Provider

.CreateQuery<TSource>(

Expression.Call(

null,

((MethodInfo)

MethodBase

.GetCurrentMethod())

.MakeGenericMethod(

new Type[] { typeof(TSource) }),

new Expression[] {

source.Expression,

Expression.Quote(predicate) }));

IQUERY

PROVIDER

IQUERY

PROVIDER

IQUERY

PROVIDER

//is it the same thing?

s1 == s2

s1.Equals(s2)

String.Equals(s1, s2)

String.Compare(s1, s2) == 0

top related