Last active
February 12, 2016 15:51
-
-
Save vendettamit/d1ca4d501d4a43423bd9 to your computer and use it in GitHub Desktop.
This file contains 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
var context = new ConferenceDb(); | |
var query = context.Set<Conference>().AsNoTracking(); | |
var predicate = ExpressionBuilder.MakePredicate<Conference>(new List<ExpressionModel>(new[] { | |
new ExpressionModel() { | |
Operator = ExpressionBuilder.ExpressionOperators.Equals, | |
PropertyName = "Slug", | |
Value = "Test" | |
}, | |
new ExpressionModel() { | |
Operator = ExpressionBuilder.ExpressionOperators.StartsWith, | |
PropertyName = "Name", | |
Value = "Amit" | |
}, | |
new ExpressionModel() { | |
Operator = ExpressionBuilder.ExpressionOperators.Contains, | |
PropertyName = "Location", | |
Value = "NY" | |
} | |
})); | |
var result = query.Where(predicate); | |
============= output ============= | |
{SELECT | |
[Extent1].[Id] AS [Id], | |
[Extent1].[Slug] AS [Slug], | |
[Extent1].[Name] AS [Name], | |
[Extent1].[Location] AS [Location], | |
[Extent1].[AccessCode] AS [AccessCode], | |
[Extent1].[OwnerName] AS [OwnerName], | |
[Extent1].[OwnerEmail] AS [OwnerEmail], | |
[Extent1].[WasEverPublished] AS [WasEverPublished], | |
[Extent1].[Description] AS [Description], | |
[Extent1].[Tagline] AS [Tagline], | |
[Extent1].[TwitterSearch] AS [TwitterSearch], | |
[Extent1].[StartDate] AS [StartDate], | |
[Extent1].[EndDate] AS [EndDate], | |
[Extent1].[IsPublished] AS [IsPublished] | |
FROM [ConferenceManagement].[Conferences] AS [Extent1] | |
WHERE (N'Test' = [Extent1].[Slug]) AND ([Extent1].[Name] LIKE N'Amit%') AND ([Extent1].[Location] LIKE N'%NY%')} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment