Created
March 3, 2010 16:30
-
-
Save chaliy/320730 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// following is analog of the o => o.ContextID == ContextId; | |
var recordType = typeof(NventstoreProduct); | |
var recordParam = Expression.Parameter(recordType, "o"); | |
var recordContextIDProperty = Expression.Property(recordParam, | |
recordType.GetProperty("ContextID")); | |
var serviceType = typeof (Nventstore); | |
var thisContextIDProperty = Expression.Property(Expression.Constant(this, serviceType), | |
serviceType.GetProperty("ContextId")); | |
var thisContextIDPropertyConveterd = Expression.Convert(thisContextIDProperty, typeof (Guid?)); | |
return Expression.Lambda<Func<NventstoreProduct, bool>>(Expression.Equal(recordContextIDProperty, thisContextIDPropertyConveterd), recordParam); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment