public override async Task Union_Skip_Take_OrderBy_ThenBy_Where(bool isAsync) { await base.Union_Skip_Take_OrderBy_ThenBy_Where(isAsync); AssertSql( $@"{AssertSqlHelper.Declaration("@__p_0='0'")} SELECT `t0`.`CustomerID`, `t0`.`Address`, `t0`.`City`, `t0`.`CompanyName`, `t0`.`ContactName`, `t0`.`ContactTitle`, `t0`.`Country`, `t0`.`Fax`, `t0`.`Phone`, `t0`.`PostalCode`, `t0`.`Region` FROM ( SELECT `t`.`CustomerID`, `t`.`Address`, `t`.`City`, `t`.`CompanyName`, `t`.`ContactName`, `t`.`ContactTitle`, `t`.`Country`, `t`.`Fax`, `t`.`Phone`, `t`.`PostalCode`, `t`.`Region` FROM ( SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` FROM `Customers` AS `c` WHERE `c`.`City` = 'Berlin' UNION SELECT `c0`.`CustomerID`, `c0`.`Address`, `c0`.`City`, `c0`.`CompanyName`, `c0`.`ContactName`, `c0`.`ContactTitle`, `c0`.`Country`, `c0`.`Fax`, `c0`.`Phone`, `c0`.`PostalCode`, `c0`.`Region` FROM `Customers` AS `c0` WHERE `c0`.`City` = 'London' ) AS `t` ORDER BY `t`.`Region`, `t`.`City` SKIP {AssertSqlHelper.Parameter("@__p_0")} ) AS `t0` WHERE CHARINDEX('Thomas', `t0`.`ContactName`) > 0 ORDER BY `t0`.`Region`, `t0`.`City`"); }
public override void RequiredAttribute_for_navigation_throws_while_inserting_null_value() { base.RequiredAttribute_for_navigation_throws_while_inserting_null_value(); AssertSql( $@"@p0=NULL (DbType = Int32) {AssertSqlHelper.Declaration("@p1='1'")} SET NOCOUNT ON; INSERT INTO `BookDetails` (`AdditionalBookDetailsId`, `AnotherBookId`) VALUES ({AssertSqlHelper.Parameter("@p0")}, {AssertSqlHelper.Parameter("@p1")}); SELECT `Id` FROM `BookDetails` WHERE @@ROWCOUNT = 1 AND `Id` = scope_identity();", // $@"@p0=NULL (DbType = Int32) @p1=NULL (Nullable = false) (DbType = Int32) SET NOCOUNT ON; INSERT INTO `BookDetails` (`AdditionalBookDetailsId`, `AnotherBookId`) VALUES ({AssertSqlHelper.Parameter("@p0")}, {AssertSqlHelper.Parameter("@p1")}); SELECT `Id` FROM `BookDetails` WHERE @@ROWCOUNT = 1 AND `Id` = scope_identity();"); }
public virtual void FromSqlRaw_in_subquery_with_positional_dbParameter_with_name() { using (var context = CreateContext()) { var actual = context.Orders.Where( o => context.Customers .FromSqlRaw( @"SELECT * FROM ""Customers"" WHERE ""City"" = {0}", // ReSharper disable once FormatStringProblem new OleDbParameter("@city", "London")) .Select(c => c.CustomerID) .Contains(o.CustomerID)) .ToArray(); Assert.Equal(46, actual.Length); AssertSql( $@"{AssertSqlHelper.Declaration("@city='London' (Nullable = false) (Size = 6)")} SELECT `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` FROM `Orders` AS `o` WHERE `o`.`CustomerID` IN ( SELECT `c`.`CustomerID` FROM ( SELECT * FROM ""Customers"" WHERE ""City"" = {AssertSqlHelper.Parameter("@city")} ) AS `c` )"); } }
public override async Task Select_Union_different_fields_in_anonymous_with_subquery(bool isAsync) { await base.Select_Union_different_fields_in_anonymous_with_subquery(isAsync); AssertSql( $@"{AssertSqlHelper.Declaration("@__p_0='1'")} {AssertSqlHelper.Declaration("@__p_1='10'")} SELECT `t0`.`Foo`, `t0`.`CustomerID`, `t0`.`Address`, `t0`.`City`, `t0`.`CompanyName`, `t0`.`ContactName`, `t0`.`ContactTitle`, `t0`.`Country`, `t0`.`Fax`, `t0`.`Phone`, `t0`.`PostalCode`, `t0`.`Region` FROM ( SELECT `t`.`Foo`, `t`.`CustomerID`, `t`.`Address`, `t`.`City`, `t`.`CompanyName`, `t`.`ContactName`, `t`.`ContactTitle`, `t`.`Country`, `t`.`Fax`, `t`.`Phone`, `t`.`PostalCode`, `t`.`Region` FROM ( SELECT `c`.`City` AS `Foo`, `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` FROM `Customers` AS `c` WHERE `c`.`City` = 'Berlin' UNION SELECT `c0`.`Region` AS `Foo`, `c0`.`CustomerID`, `c0`.`Address`, `c0`.`City`, `c0`.`CompanyName`, `c0`.`ContactName`, `c0`.`ContactTitle`, `c0`.`Country`, `c0`.`Fax`, `c0`.`Phone`, `c0`.`PostalCode`, `c0`.`Region` FROM `Customers` AS `c0` WHERE `c0`.`City` = 'London' ) AS `t` ORDER BY `t`.`Foo` SKIP {AssertSqlHelper.Parameter("@__p_0")} FETCH NEXT {AssertSqlHelper.Parameter("@__p_1")} ROWS ONLY ) AS `t0` WHERE `t0`.`Foo` = 'Berlin' ORDER BY `t0`.`Foo`"); }
public override void DbContext_property_based_filter_does_not_short_circuit() { base.DbContext_property_based_filter_does_not_short_circuit(); AssertSql( $@"{AssertSqlHelper.Declaration("@__ef_filter__p_0='False'")} {AssertSqlHelper.Declaration("@__ef_filter__IsModerated_1='True' (Nullable = true)")} SELECT `s`.`Id`, `s`.`IsDeleted`, `s`.`IsModerated` FROM `ShortCircuitFilter` AS `s` WHERE (`s`.`IsDeleted` <> True) AND (({AssertSqlHelper.Parameter("@__ef_filter__p_0")} = True) OR ({AssertSqlHelper.Parameter("@__ef_filter__IsModerated_1")} = `s`.`IsModerated`))", // $@"{AssertSqlHelper.Declaration("@__ef_filter__p_0='False'")} {AssertSqlHelper.Declaration("@__ef_filter__IsModerated_1='False' (Nullable = true)")} SELECT `s`.`Id`, `s`.`IsDeleted`, `s`.`IsModerated` FROM `ShortCircuitFilter` AS `s` WHERE (`s`.`IsDeleted` <> True) AND (({AssertSqlHelper.Parameter("@__ef_filter__p_0")} = True) OR ({AssertSqlHelper.Parameter("@__ef_filter__IsModerated_1")} = `s`.`IsModerated`))", // $@"{AssertSqlHelper.Declaration("@__ef_filter__p_0='True'")} SELECT `s`.`Id`, `s`.`IsDeleted`, `s`.`IsModerated` FROM `ShortCircuitFilter` AS `s` WHERE (`s`.`IsDeleted` <> True) AND ({AssertSqlHelper.Parameter("@__ef_filter__p_0")} = True)"); }
public override void FromSqlInterpolated_parameterization_issue_12213() { base.FromSqlInterpolated_parameterization_issue_12213(); AssertSql( $@"p0='10300' SELECT * FROM ""Orders"" WHERE ""OrderID"" >= {AssertSqlHelper.Parameter("@p0")}", // $@"{AssertSqlHelper.Declaration("@__max_0='10400'")} p0='10300' SELECT `o`.`OrderID` FROM `Orders` AS `o` WHERE (`o`.`OrderID` <= {AssertSqlHelper.Parameter("@__max_0")}) AND `o`.`OrderID` IN ( SELECT `o0`.`OrderID` FROM ( SELECT * FROM ""Orders"" WHERE ""OrderID"" >= {AssertSqlHelper.Parameter("@p0")} ) AS `o0` )", // $@"{AssertSqlHelper.Declaration("@__max_0='10400'")} p0='10300' SELECT `o`.`OrderID` FROM `Orders` AS `o` WHERE (`o`.`OrderID` <= {AssertSqlHelper.Parameter("@__max_0")}) AND `o`.`OrderID` IN ( SELECT `o0`.`OrderID` FROM ( SELECT * FROM ""Orders"" WHERE ""OrderID"" >= {AssertSqlHelper.Parameter("@p0")} ) AS `o0` )"); }
public override void DbContext_complex_expression_is_parameterized() { base.DbContext_complex_expression_is_parameterized(); AssertSql( $@"{AssertSqlHelper.Declaration("@__ef_filter__Property_0='False'")} {AssertSqlHelper.Declaration("@__ef_filter__p_1='True'")} SELECT `c`.`Id`, `c`.`IsEnabled` FROM `ComplexFilter` AS `c` WHERE (`c`.`IsEnabled` = {AssertSqlHelper.Parameter("@__ef_filter__Property_0")}) AND ({AssertSqlHelper.Parameter("@__ef_filter__p_1")} = True)", // $@"{AssertSqlHelper.Declaration("@__ef_filter__Property_0='True'")} {AssertSqlHelper.Declaration("@__ef_filter__p_1='True'")} SELECT `c`.`Id`, `c`.`IsEnabled` FROM `ComplexFilter` AS `c` WHERE (`c`.`IsEnabled` = {AssertSqlHelper.Parameter("@__ef_filter__Property_0")}) AND ({AssertSqlHelper.Parameter("@__ef_filter__p_1")} = True)", // $@"{AssertSqlHelper.Declaration("@__ef_filter__Property_0='True'")} {AssertSqlHelper.Declaration("@__ef_filter__p_1='False'")} SELECT `c`.`Id`, `c`.`IsEnabled` FROM `ComplexFilter` AS `c` WHERE (`c`.`IsEnabled` = {AssertSqlHelper.Parameter("@__ef_filter__Property_0")}) AND ({AssertSqlHelper.Parameter("@__ef_filter__p_1")} = True)"); }
public override void Save_replaced_principal() { base.Save_replaced_principal(); AssertSql( $@"SELECT TOP 2 `c`.`Id`, `c`.`Name`, `c`.`PrincipalId` FROM `Categories` AS `c`", // $@"{AssertSqlHelper.Declaration("@__category_PrincipalId_0='778' (Nullable = true)")} SELECT `p`.`Id`, `p`.`DependentId`, `p`.`Name`, `p`.`Price` FROM `Products` AS `p` WHERE `p`.`DependentId` = {AssertSqlHelper.Parameter("@__category_PrincipalId_0")}", // $@"{AssertSqlHelper.Declaration("@p1='78'")} {AssertSqlHelper.Declaration("@p0='New Category' (Size = 4000)")} SET NOCOUNT ON; UPDATE `Categories` SET `Name` = {AssertSqlHelper.Parameter("@p0")} WHERE `Id` = {AssertSqlHelper.Parameter("@p1")}; SELECT @@ROWCOUNT;", // $@"SELECT TOP 2 `c`.`Id`, `c`.`Name`, `c`.`PrincipalId` FROM `Categories` AS `c`", // $@"{AssertSqlHelper.Declaration("@__category_PrincipalId_0='778' (Nullable = true)")} SELECT `p`.`Id`, `p`.`DependentId`, `p`.`Name`, `p`.`Price` FROM `Products` AS `p` WHERE `p`.`DependentId` = {AssertSqlHelper.Parameter("@__category_PrincipalId_0")}"); }
public override void Navs_query() { base.Navs_query(); AssertSql( $@"{AssertSqlHelper.Declaration("@__ef_filter__TenantPrefix_0='B' (Size = 4000)")} {AssertSqlHelper.Declaration("@__ef_filter___quantity_1='50'")} SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` FROM `Customers` AS `c` INNER JOIN ( SELECT `o`.`OrderID`, `o`.`CustomerID`, `o`.`EmployeeID`, `o`.`OrderDate` FROM `Orders` AS `o` LEFT JOIN ( SELECT `c0`.`CustomerID`, `c0`.`Address`, `c0`.`City`, `c0`.`CompanyName`, `c0`.`ContactName`, `c0`.`ContactTitle`, `c0`.`Country`, `c0`.`Fax`, `c0`.`Phone`, `c0`.`PostalCode`, `c0`.`Region` FROM `Customers` AS `c0` WHERE ({AssertSqlHelper.Parameter("@__ef_filter__TenantPrefix_0")} = '') OR (`c0`.`CompanyName` IS NOT NULL AND (LEFT(`c0`.`CompanyName`, LEN({AssertSqlHelper.Parameter("@__ef_filter__TenantPrefix_0")})) = {AssertSqlHelper.Parameter("@__ef_filter__TenantPrefix_0")})) ) AS `t` ON `o`.`CustomerID` = `t`.`CustomerID` WHERE `t`.`CustomerID` IS NOT NULL AND `t`.`CompanyName` IS NOT NULL ) AS `t0` ON `c`.`CustomerID` = `t0`.`CustomerID` INNER JOIN ( SELECT `o0`.`OrderID`, `o0`.`ProductID`, `o0`.`Discount`, `o0`.`Quantity`, `o0`.`UnitPrice` FROM `Order Details` AS `o0` WHERE `o0`.`Quantity` > {AssertSqlHelper.Parameter("@__ef_filter___quantity_1")} ) AS `t1` ON `t0`.`OrderID` = `t1`.`OrderID` WHERE (({AssertSqlHelper.Parameter("@__ef_filter__TenantPrefix_0")} = '') OR (`c`.`CompanyName` IS NOT NULL AND (LEFT(`c`.`CompanyName`, LEN({AssertSqlHelper.Parameter("@__ef_filter__TenantPrefix_0")})) = {AssertSqlHelper.Parameter("@__ef_filter__TenantPrefix_0")}))) AND (`t1`.`Discount` < IIf(10 IS NULL, NULL, CSNG(10)))"); }
public override void Property_entry_original_value_is_set() { base.Property_entry_original_value_is_set(); AssertSql( $@"SELECT TOP 1 `e`.`Id`, `e`.`EngineSupplierId`, `e`.`Name`, `t`.`Id`, `t`.`StorageLocation_Latitude`, `t`.`StorageLocation_Longitude` FROM `Engines` AS `e` LEFT JOIN ( SELECT `e0`.`Id`, `e0`.`StorageLocation_Latitude`, `e0`.`StorageLocation_Longitude`, `e1`.`Id` AS `Id0` FROM `Engines` AS `e0` INNER JOIN `Engines` AS `e1` ON `e0`.`Id` = `e1`.`Id` WHERE `e0`.`StorageLocation_Longitude` IS NOT NULL AND `e0`.`StorageLocation_Latitude` IS NOT NULL ) AS `t` ON `e`.`Id` = `t`.`Id` ORDER BY `e`.`Id`", // $@"{AssertSqlHelper.Declaration("@p1='1'")} {AssertSqlHelper.Declaration("@p2='1'")} {AssertSqlHelper.Declaration("@p0='FO 108X' (Size = 4000)")} {AssertSqlHelper.Declaration("@p3='ChangedEngine' (Size = 4000)")} {AssertSqlHelper.Declaration("@p4='47.64491'")} {AssertSqlHelper.Declaration("@p5='-122.128101'")} SET NOCOUNT ON; UPDATE `Engines` SET `Name` = {AssertSqlHelper.Parameter("@p0")} WHERE `Id` = {AssertSqlHelper.Parameter("@p1")} AND `EngineSupplierId` = {AssertSqlHelper.Parameter("@p2")} AND `Name` = {AssertSqlHelper.Parameter("@p3")} AND `StorageLocation_Latitude` = {AssertSqlHelper.Parameter("@p4")} AND `StorageLocation_Longitude` = {AssertSqlHelper.Parameter("@p5")}; SELECT @@ROWCOUNT;"); }
public override async Task Union_Take_Union_Take(bool isAsync) { await base.Union_Take_Union_Take(isAsync); AssertSql( $@"{AssertSqlHelper.Declaration("@__p_0='1'")} SELECT `t2`.`CustomerID`, `t2`.`Address`, `t2`.`City`, `t2`.`CompanyName`, `t2`.`ContactName`, `t2`.`ContactTitle`, `t2`.`Country`, `t2`.`Fax`, `t2`.`Phone`, `t2`.`PostalCode`, `t2`.`Region` FROM ( SELECT TOP {AssertSqlHelper.Parameter("@__p_0")} `t1`.`CustomerID`, `t1`.`Address`, `t1`.`City`, `t1`.`CompanyName`, `t1`.`ContactName`, `t1`.`ContactTitle`, `t1`.`Country`, `t1`.`Fax`, `t1`.`Phone`, `t1`.`PostalCode`, `t1`.`Region` FROM ( SELECT `t0`.`CustomerID`, `t0`.`Address`, `t0`.`City`, `t0`.`CompanyName`, `t0`.`ContactName`, `t0`.`ContactTitle`, `t0`.`Country`, `t0`.`Fax`, `t0`.`Phone`, `t0`.`PostalCode`, `t0`.`Region` FROM ( SELECT TOP {AssertSqlHelper.Parameter("@__p_0")} `t`.`CustomerID`, `t`.`Address`, `t`.`City`, `t`.`CompanyName`, `t`.`ContactName`, `t`.`ContactTitle`, `t`.`Country`, `t`.`Fax`, `t`.`Phone`, `t`.`PostalCode`, `t`.`Region` FROM ( SELECT `c`.`CustomerID`, `c`.`Address`, `c`.`City`, `c`.`CompanyName`, `c`.`ContactName`, `c`.`ContactTitle`, `c`.`Country`, `c`.`Fax`, `c`.`Phone`, `c`.`PostalCode`, `c`.`Region` FROM `Customers` AS `c` WHERE `c`.`City` = 'Berlin' UNION SELECT `c0`.`CustomerID`, `c0`.`Address`, `c0`.`City`, `c0`.`CompanyName`, `c0`.`ContactName`, `c0`.`ContactTitle`, `c0`.`Country`, `c0`.`Fax`, `c0`.`Phone`, `c0`.`PostalCode`, `c0`.`Region` FROM `Customers` AS `c0` WHERE `c0`.`City` = 'London' ) AS `t` ORDER BY `t`.`CustomerID` ) AS `t0` UNION SELECT `c1`.`CustomerID`, `c1`.`Address`, `c1`.`City`, `c1`.`CompanyName`, `c1`.`ContactName`, `c1`.`ContactTitle`, `c1`.`Country`, `c1`.`Fax`, `c1`.`Phone`, `c1`.`PostalCode`, `c1`.`Region` FROM `Customers` AS `c1` WHERE `c1`.`City` = 'Mannheim' ) AS `t1` ) AS `t2` ORDER BY `t2`.`CustomerID`"); }
public override void Executes_stored_procedure_with_generated_parameter() { base.Executes_stored_procedure_with_generated_parameter(); AssertSql( $@"{AssertSqlHelper.Declaration("@p0='ALFKI' (Size = 4000)")} `CustOrderHist` @CustomerID = {AssertSqlHelper.Parameter("@p0")}"); }
public override void FromSqlInterpolated_with_inlined_db_parameter() { base.FromSqlInterpolated_with_inlined_db_parameter(); AssertSql( $@"{AssertSqlHelper.Declaration("@somename='ALFKI' (Nullable = false) (Size = 5)")} SELECT * FROM ""Customers"" WHERE ""CustomerID"" = {AssertSqlHelper.Parameter("@somename")}"); }
public override void Query_with_positional_dbParameter_without_name() { base.Query_with_positional_dbParameter_without_name(); AssertSql( $@"{AssertSqlHelper.Declaration("@p0='London' (Nullable = false) (Size = 6)")} SELECT COUNT(*) FROM ""Customers"" WHERE ""City"" = {AssertSqlHelper.Parameter("@p0")}"); }
public override void FromSqlRaw_with_dbParameter() { base.FromSqlRaw_with_dbParameter(); AssertSql( $@"{AssertSqlHelper.Declaration("@city='London' (Nullable = false) (Size = 6)")} SELECT * FROM ""Customers"" WHERE ""City"" = {AssertSqlHelper.Parameter("@city")}"); }
public override void Executes_stored_procedure_with_parameter() { base.Executes_stored_procedure_with_parameter(); AssertSql( $@"{AssertSqlHelper.Declaration("@CustomerID='ALFKI' (Nullable = false) (Size = 5)")} `CustOrderHist` @CustomerID"); }
public override void Scalar_Function_Constant_Parameter_Static() { base.Scalar_Function_Constant_Parameter_Static(); AssertSql( $@"{AssertSqlHelper.Declaration("@__customerId_0='1'")} SELECT `CustomerOrderCount`({AssertSqlHelper.Parameter("@__customerId_0")}) FROM `Customers` AS `c`"); }
public override async Task Select_scalar_primitive_after_take(bool isAsync) { await base.Select_scalar_primitive_after_take(isAsync); AssertSql( $@"{AssertSqlHelper.Declaration("@__p_0='9'")} SELECT TOP {AssertSqlHelper.Parameter("@__p_0")} `e`.`EmployeeID` FROM `Employees` AS `e`"); }
public override async Task Select_bool_closure_with_order_parameter_with_cast_to_nullable(bool isAsync) { await base.Select_bool_closure_with_order_parameter_with_cast_to_nullable(isAsync); AssertSql( $@"{AssertSqlHelper.Declaration("@__boolean_0='False'")} SELECT {AssertSqlHelper.Parameter("@__boolean_0")} FROM `Customers` AS `c`"); }
public override async Task Select_local(bool isAsync) { await base.Select_local(isAsync); AssertSql( $@"{AssertSqlHelper.Declaration("@__x_0='10'")} SELECT {AssertSqlHelper.Parameter("@__x_0")} FROM `Customers` AS `c`"); }
public override void Scalar_Function_Let_Not_Parameter_Instance() { base.Scalar_Function_Let_Not_Parameter_Instance(); AssertSql( $@"{AssertSqlHelper.Declaration("@__customerId_1='2'")} SELECT TOP 2 `c`.`LastName`, `CustomerOrderCount`({AssertSqlHelper.Parameter("@__customerId_1")}) AS `OrderCount` FROM `Customers` AS `c` WHERE `c`.`Id` = {AssertSqlHelper.Parameter("@__customerId_1")}"); }
public override void Scalar_Function_Where_Parameter_Instance() { base.Scalar_Function_Where_Parameter_Instance(); AssertSql( $@"{AssertSqlHelper.Declaration("@__period_1='0'")} SELECT TOP 2 `c`.`Id` FROM `Customers` AS `c` WHERE `c`.`Id` = `GetCustomerWithMostOrdersAfterDate`(`GetReportingPeriodStartDate`({AssertSqlHelper.Parameter("@__period_1")}))"); }
public override void Scalar_Function_With_Translator_Translates_Static() { base.Scalar_Function_With_Translator_Translates_Static(); AssertSql( $@"{AssertSqlHelper.Declaration("@__customerId_0='3'")} SELECT TOP 2 len(`c`.`LastName`) FROM `Customers` AS `c` WHERE `c`.`Id` = {AssertSqlHelper.Parameter("@__customerId_0")}"); }
public override void Scalar_Function_Where_Not_Correlated_Instance() { base.Scalar_Function_Where_Not_Correlated_Instance(); AssertSql( $@"{AssertSqlHelper.Declaration("@__startDate_1='2000-04-01T00:00:00' (Nullable = true)")} SELECT TOP 2 `c`.`Id` FROM `Customers` AS `c` WHERE `GetCustomerWithMostOrdersAfterDate`({AssertSqlHelper.Parameter("@__startDate_1")}) = `c`.`Id`"); }
public override void Can_insert_update_delete() { base.Can_insert_update_delete(); AssertSql( $@"SELECT TOP 2 `c`.`Id`, `c`.`Name` FROM `Country` AS `c` WHERE `c`.`Id` = 1", // $@"{AssertSqlHelper.Declaration("@p0='Apteryx owenii' (Nullable = false) (Size = 100)")} {AssertSqlHelper.Declaration("@p1='1'")} {AssertSqlHelper.Declaration("@p2='Kiwi' (Nullable = false) (Size = 4000)")} {AssertSqlHelper.Declaration("@p3='Little spotted kiwi' (Size = 4000)")} @p4=NULL (Size = 100) {AssertSqlHelper.Declaration("@p5='True'")} {AssertSqlHelper.Declaration("@p6='0' (Size = 1)")} SET NOCOUNT ON; INSERT INTO `Animal` (`Species`, `CountryId`, `Discriminator`, `Name`, `EagleId`, `IsFlightless`, `FoundOn`) VALUES ({AssertSqlHelper.Parameter("@p0")}, {AssertSqlHelper.Parameter("@p1")}, {AssertSqlHelper.Parameter("@p2")}, {AssertSqlHelper.Parameter("@p3")}, {AssertSqlHelper.Parameter("@p4")}, {AssertSqlHelper.Parameter("@p5")}, {AssertSqlHelper.Parameter("@p6")});", // $@"SELECT TOP 2 `a`.`Species`, `a`.`CountryId`, `a`.`Discriminator`, `a`.`Name`, `a`.`EagleId`, `a`.`IsFlightless`, `a`.`FoundOn` FROM `Animal` AS `a` WHERE (`a`.`Discriminator` = 'Kiwi') AND (`a`.`Species` LIKE '%owenii')", // $@"{AssertSqlHelper.Declaration("@p1='Apteryx owenii' (Nullable = false) (Size = 100)")} {AssertSqlHelper.Declaration("@p0='Aquila chrysaetos canadensis' (Size = 100)")} SET NOCOUNT ON; UPDATE `Animal` SET `EagleId` = {AssertSqlHelper.Parameter("@p0")} WHERE `Species` = {AssertSqlHelper.Parameter("@p1")}; SELECT @@ROWCOUNT;", // $@"SELECT TOP 2 `a`.`Species`, `a`.`CountryId`, `a`.`Discriminator`, `a`.`Name`, `a`.`EagleId`, `a`.`IsFlightless`, `a`.`FoundOn` FROM `Animal` AS `a` WHERE (`a`.`Discriminator` = 'Kiwi') AND (`a`.`Species` LIKE '%owenii')", // $@"{AssertSqlHelper.Declaration("@p0='Apteryx owenii' (Nullable = false) (Size = 100)")} SET NOCOUNT ON; DELETE FROM `Animal` WHERE `Species` = {AssertSqlHelper.Parameter("@p0")}; SELECT @@ROWCOUNT;", // $@"SELECT COUNT(*) FROM `Animal` AS `a` WHERE (`a`.`Discriminator` = 'Kiwi') AND (`a`.`Species` LIKE '%owenii')"); }
public override void Remote_method_DbContext_property_method_call_is_parameterized() { base.Remote_method_DbContext_property_method_call_is_parameterized(); AssertSql( $@"{AssertSqlHelper.Declaration("@__ef_filter__p_0='2'")} SELECT `r`.`Id`, `r`.`Tenant` FROM `RemoteMethodParamsFilter` AS `r` WHERE `r`.`Tenant` = {AssertSqlHelper.Parameter("@__ef_filter__p_0")}"); }
public override void DbContext_method_call_is_parameterized() { base.DbContext_method_call_is_parameterized(); AssertSql( $@"{AssertSqlHelper.Declaration("@__ef_filter__p_0='2'")} SELECT `m`.`Id`, `m`.`Tenant` FROM `MethodCallFilter` AS `m` WHERE `m`.`Tenant` = {AssertSqlHelper.Parameter("@__ef_filter__p_0")}"); }
public override void Scalar_Function_Anonymous_Type_Select_Parameter_Static() { base.Scalar_Function_Anonymous_Type_Select_Parameter_Static(); AssertSql( $@"{AssertSqlHelper.Declaration("@__customerId_0='1'")} SELECT TOP 2 `c`.`LastName`, `CustomerOrderCount`({AssertSqlHelper.Parameter("@__customerId_0")}) AS `OrderCount` FROM `Customers` AS `c` WHERE `c`.`Id` = {AssertSqlHelper.Parameter("@__customerId_0")}"); }
public override void Compiled_query_when_does_not_end_in_query_operator() { base.Compiled_query_when_does_not_end_in_query_operator(); AssertSql( $@"{AssertSqlHelper.Declaration("@__customerID='ALFKI' (Size = 5)")} SELECT COUNT(*) FROM `Customers` AS `c` WHERE `c`.`CustomerID` = {AssertSqlHelper.Parameter("@__customerID")}"); }
public override void EntityTypeConfiguration_DbContext_method_call_is_parameterized() { base.EntityTypeConfiguration_DbContext_method_call_is_parameterized(); AssertSql( $@"{AssertSqlHelper.Declaration("@__ef_filter__p_0='2'")} SELECT `e`.`Id`, `e`.`Tenant` FROM `EntityTypeConfigurationMethodCallFilter` AS `e` WHERE `e`.`Tenant` = {AssertSqlHelper.Parameter("@__ef_filter__p_0")}"); }