public void Is() { CheckQuery( Cooks.Where(c => c is Chef), "SELECT [t0].[ID],[t0].[FirstName],[t0].[Name],[t0].[IsStarredCook],[t0].[IsFullTimeCook],[t0].[SubstitutedID],[t0].[KitchenID]," + "[t0].[KnifeID],[t0].[KnifeClassID] " + "FROM [CookTable] AS [t0] WHERE ([t0].[IsStarredCook] = 1)" ); CheckQuery( #pragma warning disable 183 Cooks.Where(c => c is Cook), #pragma warning restore 183 "SELECT [t0].[ID],[t0].[FirstName],[t0].[Name],[t0].[IsStarredCook],[t0].[IsFullTimeCook],[t0].[SubstitutedID],[t0].[KitchenID]," + "[t0].[KnifeID],[t0].[KnifeClassID] " + "FROM [CookTable] AS [t0] WHERE (@1 = 1)", new CommandParameter("@1", 1) ); CheckQuery( #pragma warning disable 183 Chefs.Where(c => c is Cook), #pragma warning restore 183 "SELECT [t0].[ID],[t0].[FirstName],[t0].[Name],[t0].[IsStarredCook],[t0].[IsFullTimeCook],[t0].[SubstitutedID],[t0].[KitchenID]," + "[t0].[KnifeID],[t0].[KnifeClassID]," + "[t0].[LetterOfRecommendation] FROM [dbo].[ChefTable] AS [t0] WHERE (@1 = 1)", new CommandParameter("@1", 1)); CheckQuery( #pragma warning disable 183 Chefs.Where(c => c is Chef), #pragma warning restore 183 "SELECT [t0].[ID],[t0].[FirstName],[t0].[Name],[t0].[IsStarredCook],[t0].[IsFullTimeCook],[t0].[SubstitutedID],[t0].[KitchenID]," + "[t0].[KnifeID],[t0].[KnifeClassID]," + "[t0].[LetterOfRecommendation] FROM [dbo].[ChefTable] AS [t0] WHERE (@1 = 1)", new CommandParameter("@1", 1)); }
public void SetOperation_WithDifferentTypes() { CheckQuery( () => Cooks.Where(c => c.FirstName == "Hugo").Select(c => c.ID).Union(Chefs.Where(c => c.Name == "Boss").Select(c => c.ID)), "SELECT [t0].[ID] AS [value] FROM [CookTable] AS [t0] WHERE ([t0].[FirstName] = @1) " + "UNION (SELECT [t1].[ID] AS [value] FROM [dbo].[ChefTable] AS [t1] WHERE ([t1].[Name] = @2))", row => (object)row.GetValue <int> (new ColumnID("value", 0)), new CommandParameter("@1", "Hugo"), new CommandParameter("@2", "Boss")); CheckQuery( () => Cooks.Where(c => c.FirstName == "Hugo").Select(c => c.ID).Union(Kitchens.Where(c => c.Name == "Nino's Kitchen").Select(c => c.ID)), "SELECT [t0].[ID] AS [value] FROM [CookTable] AS [t0] WHERE ([t0].[FirstName] = @1) " + "UNION (SELECT [t1].[ID] AS [value] FROM [KitchenTable] AS [t1] WHERE ([t1].[Name] = @2))", row => (object)row.GetValue <int> (new ColumnID("value", 0)), new CommandParameter("@1", "Hugo"), new CommandParameter("@2", "Nino's Kitchen")); }