Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
648
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 37.85 KB | None | 0 0
  1. SELECT
  2.     [UnionAll3].[IsoCountryCode] AS [C1],
  3.     [UnionAll3].[NameContentId] AS [C2],
  4.     [UnionAll3].[Disabled] AS [C3],
  5.     [UnionAll3].[Email] AS [C4],
  6.     [UnionAll3].[Fax] AS [C5],
  7.     [UnionAll3].[Id] AS [C6],
  8.     [UnionAll3].[C4] AS [C7],
  9.     [UnionAll3].[C5] AS [C8],
  10.     [UnionAll3].[C6] AS [C9],
  11.     [UnionAll3].[PostalCode] AS [C10],
  12.     [UnionAll3].[PhoneSupport] AS [C11],
  13.     [UnionAll3].[PhoneSales] AS [C12],
  14.     [UnionAll3].[PhoneAfterHoursSupport] AS [C13],
  15.     [UnionAll3].[Phone] AS [C14],
  16.     [UnionAll3].[Preferred] AS [C15],
  17.     [UnionAll3].[ShopOnlineImageUrl] AS [C16],
  18.     [UnionAll3].[AdditionalInformationContentId] AS [C17],
  19.     [UnionAll3].[AddressLine1ContentId] AS [C18],
  20.     [UnionAll3].[AddressLine2ContentId] AS [C19],
  21.     [UnionAll3].[CityContentId] AS [C20],
  22.     [UnionAll3].[StateOrProvinceContentId] AS [C21],
  23.     [UnionAll3].[NameContentId1] AS [C22],
  24.     [UnionAll3].[HoursOfOperationContentId] AS [C23],
  25.     [UnionAll3].[WebsiteContentId] AS [C24],
  26.     [UnionAll3].[OnlineSellerHomePageUrlContentId] AS [C25],
  27.     [UnionAll3].[ContactFormUrlContentId] AS [C26],
  28.     [UnionAll3].[RequestAQuoteUrlContentId] AS [C27],
  29.     [UnionAll3].[NameContentId2] AS [C28],
  30.     [UnionAll3].[C1] AS [C29],
  31.     [UnionAll3].[ContactId] AS [C30],
  32.     [UnionAll3].[BrandId] AS [C31],
  33.     [UnionAll3].[BrandId1] AS [C32],
  34.     [UnionAll3].[Id1] AS [C33],
  35.     [UnionAll3].[Name] AS [C34],
  36.     [UnionAll3].[C7] AS [C35],
  37.     [UnionAll3].[VALUE] AS [C36],
  38.     [UnionAll3].[C8] AS [C37],
  39.     [UnionAll3].[C9] AS [C38],
  40.     [UnionAll3].[C10] AS [C39],
  41.     [UnionAll3].[C11] AS [C40],
  42.     [UnionAll3].[C12] AS [C41],
  43.     [UnionAll3].[C13] AS [C42],
  44.     [UnionAll3].[C14] AS [C43],
  45.     [UnionAll3].[C15] AS [C44]
  46.     FROM  (SELECT
  47.         CASE WHEN ([Join5].[ContactId] IS NULL) THEN CAST(NULL AS INT) ELSE 1 END AS [C1],
  48.         [Limit1].[C1] AS [C2],
  49.         [Limit1].[C4] AS [C3],
  50.         [Limit1].[IsoCountryCode] AS [IsoCountryCode],
  51.         [Limit1].[NameContentId] AS [NameContentId],
  52.         [Limit1].[Disabled] AS [Disabled],
  53.         [Limit1].[Email] AS [Email],
  54.         [Limit1].[Fax] AS [Fax],
  55.         [Limit1].[Id] AS [Id],
  56.         [Limit1].[C2] AS [C4],
  57.         [Limit1].[C3] AS [C5],
  58.         [Limit1].[C4] AS [C6],
  59.         [Limit1].[PostalCode] AS [PostalCode],
  60.         [Limit1].[PhoneSupport] AS [PhoneSupport],
  61.         [Limit1].[PhoneSales] AS [PhoneSales],
  62.         [Limit1].[PhoneAfterHoursSupport] AS [PhoneAfterHoursSupport],
  63.         [Limit1].[Phone] AS [Phone],
  64.         [Limit1].[Preferred] AS [Preferred],
  65.         [Limit1].[ShopOnlineImageUrl] AS [ShopOnlineImageUrl],
  66.         [Limit1].[AdditionalInformationContentId] AS [AdditionalInformationContentId],
  67.         [Limit1].[AddressLine1ContentId] AS [AddressLine1ContentId],
  68.         [Limit1].[AddressLine2ContentId] AS [AddressLine2ContentId],
  69.         [Limit1].[CityContentId] AS [CityContentId],
  70.         [Limit1].[StateOrProvinceContentId] AS [StateOrProvinceContentId],
  71.         [Limit1].[NameContentId1] AS [NameContentId1],
  72.         [Limit1].[HoursOfOperationContentId] AS [HoursOfOperationContentId],
  73.         [Limit1].[WebsiteContentId] AS [WebsiteContentId],
  74.         [Limit1].[OnlineSellerHomePageUrlContentId] AS [OnlineSellerHomePageUrlContentId],
  75.         [Limit1].[ContactFormUrlContentId] AS [ContactFormUrlContentId],
  76.         [Limit1].[RequestAQuoteUrlContentId] AS [RequestAQuoteUrlContentId],
  77.         [Limit1].[NameContentId] AS [NameContentId2],
  78.         [Join5].[ContactId] AS [ContactId],
  79.         [Join5].[BrandId1] AS [BrandId],
  80.         [Join5].[BrandId1] AS [BrandId1],
  81.         [Join5].[Id1] AS [Id1],
  82.         [Join5].[Name] AS [Name],
  83.         CASE WHEN ([Join5].[ContactId] IS NULL) THEN CAST(NULL AS INT) WHEN ([Join5].[BrandId2] IS NULL) THEN CAST(NULL AS INT) ELSE 1 END AS [C7],
  84.         [Join5].[VALUE] AS [VALUE],
  85.         CAST(NULL AS INT) AS [C8],
  86.         CAST(NULL AS INT) AS [C9],
  87.         CAST(NULL AS INT) AS [C10],
  88.         CAST(NULL AS INT) AS [C11],
  89.         CAST(NULL AS INT) AS [C12],
  90.         CAST(NULL AS VARCHAR(1)) AS [C13],
  91.         CAST(NULL AS VARCHAR(1)) AS [C14],
  92.         CAST(NULL AS INT) AS [C15]
  93.         FROM   (SELECT [Project9].[C1] AS [C1], [Project9].[Id] AS [Id], [Project9].[Disabled] AS [Disabled], [Project9].[NameContentId] AS [NameContentId], [Project9].[AddressLine1ContentId] AS [AddressLine1ContentId], [Project9].[AddressLine2ContentId] AS [AddressLine2ContentId], [Project9].[CityContentId] AS [CityContentId], [Project9].[StateOrProvinceContentId] AS [StateOrProvinceContentId], [Project9].[HoursOfOperationContentId] AS [HoursOfOperationContentId], [Project9].[AdditionalInformationContentId] AS [AdditionalInformationContentId], [Project9].[WebsiteContentId] AS [WebsiteContentId], [Project9].[ContactFormUrlContentId] AS [ContactFormUrlContentId], [Project9].[RequestAQuoteUrlContentId] AS [RequestAQuoteUrlContentId], [Project9].[OnlineSellerHomePageUrlContentId] AS [OnlineSellerHomePageUrlContentId], [Project9].[PostalCode] AS [PostalCode], [Project9].[Email] AS [Email], [Project9].[Phone] AS [Phone], [Project9].[PhoneAfterHoursSupport] AS [PhoneAfterHoursSupport], [Project9].[PhoneSales] AS [PhoneSales], [Project9].[PhoneSupport] AS [PhoneSupport], [Project9].[Fax] AS [Fax], [Project9].[Preferred] AS [Preferred], [Project9].[ShopOnlineImageUrl] AS [ShopOnlineImageUrl], [Project9].[IsoCountryCode] AS [IsoCountryCode], [Project9].[NameContentId1] AS [NameContentId1], [Project9].[C2] AS [C2], [Project9].[C3] AS [C3], [Project9].[C4] AS [C4]
  94.             FROM ( SELECT
  95.                 CASE WHEN ([Extent1].[Preferred] <> 1) THEN CAST(1 AS bit) WHEN ([Extent1].[Preferred] = 1) THEN CAST(0 AS bit) END AS [C1],
  96.                 [Extent1].[Id] AS [Id],
  97.                 [Extent1].[Disabled] AS [Disabled],
  98.                 [Extent1].[NameContentId] AS [NameContentId],
  99.                 [Extent1].[AddressLine1ContentId] AS [AddressLine1ContentId],
  100.                 [Extent1].[AddressLine2ContentId] AS [AddressLine2ContentId],
  101.                 [Extent1].[CityContentId] AS [CityContentId],
  102.                 [Extent1].[StateOrProvinceContentId] AS [StateOrProvinceContentId],
  103.                 [Extent1].[HoursOfOperationContentId] AS [HoursOfOperationContentId],
  104.                 [Extent1].[AdditionalInformationContentId] AS [AdditionalInformationContentId],
  105.                 [Extent1].[WebsiteContentId] AS [WebsiteContentId],
  106.                 [Extent1].[ContactFormUrlContentId] AS [ContactFormUrlContentId],
  107.                 [Extent1].[RequestAQuoteUrlContentId] AS [RequestAQuoteUrlContentId],
  108.                 [Extent1].[OnlineSellerHomePageUrlContentId] AS [OnlineSellerHomePageUrlContentId],
  109.                 [Extent1].[PostalCode] AS [PostalCode],
  110.                 [Extent1].[Email] AS [Email],
  111.                 [Extent1].[Phone] AS [Phone],
  112.                 [Extent1].[PhoneAfterHoursSupport] AS [PhoneAfterHoursSupport],
  113.                 [Extent1].[PhoneSales] AS [PhoneSales],
  114.                 [Extent1].[PhoneSupport] AS [PhoneSupport],
  115.                 [Extent1].[Fax] AS [Fax],
  116.                 [Extent1].[Preferred] AS [Preferred],
  117.                 [Extent1].[ShopOnlineImageUrl] AS [ShopOnlineImageUrl],
  118.                 [Extent2].[IsoCountryCode] AS [IsoCountryCode],
  119.                 [Extent2].[NameContentId] AS [NameContentId1],
  120.                 CASE WHEN ([Extent1].[Coordinates] IS NOT NULL) THEN [Extent1].[Coordinates].Lat ELSE CAST(0 AS FLOAT(53)) END AS [C2],
  121.                 CASE WHEN ([Extent1].[Coordinates] IS NOT NULL) THEN [Extent1].[Coordinates].Long ELSE CAST(0 AS FLOAT(53)) END AS [C3],
  122.                 CASE WHEN ((@p__linq__7 IS NOT NULL) AND ([Extent1].[Coordinates] IS NOT NULL)) THEN (@p__linq__8.STDistance([Extent1].[Coordinates])) * @p__linq__9 ELSE CAST(0 AS FLOAT(53)) END AS [C4]
  123.                 FROM  [dbo].[Contact] AS [Extent1]
  124.                 LEFT OUTER JOIN [dbo].[Country] AS [Extent2] ON [Extent1].[IsoCountryCode] = [Extent2].[IsoCountryCode]
  125.                 WHERE ([Extent1].[Disabled] = @p__linq__0) AND ( EXISTS (SELECT
  126.                     1 AS [C1]
  127.                     FROM [dbo].[ContactBrands] AS [Extent3]
  128.                     WHERE ([Extent1].[Id] = [Extent3].[ContactId]) AND ([Extent3].[BrandId] IN (57))
  129.                 )) AND ( EXISTS (SELECT
  130.                     1 AS [C1]
  131.                     FROM [dbo].[ContactToContactType] AS [Extent4]
  132.                     WHERE ([Extent1].[Id] = [Extent4].[ContactId]) AND ([Extent4].[ContactTypeId] IN (6))
  133.                 )) AND ( EXISTS (SELECT
  134.                     1 AS [C1]
  135.                     FROM  [dbo].[ContactToContactType] AS [Extent5]
  136.                     INNER JOIN [dbo].[ContactType] AS [Extent6] ON [Extent6].[Id] = [Extent5].[ContactTypeId]
  137.                     WHERE ([Extent1].[Id] = [Extent5].[ContactId]) AND ([Extent6].[ConnectWithId] = @p__linq__1)
  138.                 )) AND ((([Extent1].[HasSpecialCoverage] <> 1) AND ((@p__linq__2.STDistance([Extent1].[Coordinates])) <= @p__linq__3)) OR ((( EXISTS (SELECT
  139.                     1 AS [C1]
  140.                     FROM  [dbo].[ContactCountiesOfCoverage] AS [Extent7]
  141.                     INNER JOIN [dbo].[County] AS [Extent8] ON [Extent8].[Id] = [Extent7].[CountyId]
  142.                     WHERE ([Extent1].[Id] = [Extent7].[ContactId]) AND (([Extent8].[Name] = @p__linq__4) OR (([Extent8].[Name] IS NULL) AND (@p__linq__4 IS NULL))) AND (([Extent8].[IsoStateCode] = @p__linq__5) OR (([Extent8].[IsoStateCode] IS NULL) AND (@p__linq__5 IS NULL)))
  143.                 )) OR ( EXISTS (SELECT
  144.                     1 AS [C1]
  145.                     FROM [dbo].[ContactStatesOfCoverage] AS [Extent9]
  146.                     WHERE ([Extent1].[Id] = [Extent9].[ContactId]) AND ([Extent9].[IsoStateCode] = @p__linq__6)
  147.                 )) OR ( EXISTS (SELECT
  148.                     1 AS [C1]
  149.                     FROM ( SELECT
  150.                         N'US' AS [C1]
  151.                         FROM  ( SELECT 1 AS X ) AS [SingleRowTable1]
  152.                     )  AS [Project6]
  153.                     WHERE  EXISTS (SELECT
  154.                         1 AS [C1]
  155.                         FROM [dbo].[ContactCountriesOfCoverage] AS [Extent10]
  156.                         WHERE ([Extent1].[Id] = [Extent10].[ContactId]) AND ([Extent10].[IsoCountryCode] = [Project6].[C1])
  157.                     )
  158.                 ))) AND ([Extent1].[HasSpecialCoverage] = 1)))
  159.             )  AS [Project9]
  160.             ORDER BY ROW_NUMBER() OVER (ORDER BY [Project9].[C1] ASC, [Project9].[C4] ASC)
  161.             OFFSET 0 ROWS FETCH NEXT 25 ROWS ONLY  ) AS [Limit1]
  162.         LEFT OUTER JOIN  (SELECT [Extent11].[ContactId] AS [ContactId], [Extent11].[BrandId] AS [BrandId1], [Extent12].[Id] AS [Id1], [Extent12].[Name] AS [Name], [Extent13].[VALUE] AS [VALUE], [Extent13].[BrandId] AS [BrandId2]
  163.             FROM   [dbo].[ContactBrands] AS [Extent11]
  164.             INNER JOIN [dbo].[Brand] AS [Extent12] ON [Extent12].[Id] = [Extent11].[BrandId]
  165.             LEFT OUTER JOIN [dbo].[AliasEntities] AS [Extent13] ON [Extent12].[Id] = [Extent13].[BrandId] ) AS [Join5] ON [Limit1].[Id] = [Join5].[ContactId]
  166.     UNION ALL
  167.         SELECT
  168.         2 AS [C1],
  169.         [Limit2].[C4] AS [C2],
  170.         [Limit2].[C3] AS [C3],
  171.         [Limit2].[IsoCountryCode] AS [IsoCountryCode],
  172.         [Limit2].[NameContentId] AS [NameContentId],
  173.         [Limit2].[Disabled] AS [Disabled],
  174.         [Limit2].[Email] AS [Email],
  175.         [Limit2].[Fax] AS [Fax],
  176.         [Limit2].[Id] AS [Id],
  177.         [Limit2].[C1] AS [C4],
  178.         [Limit2].[C2] AS [C5],
  179.         [Limit2].[C3] AS [C6],
  180.         [Limit2].[PostalCode] AS [PostalCode],
  181.         [Limit2].[PhoneSupport] AS [PhoneSupport],
  182.         [Limit2].[PhoneSales] AS [PhoneSales],
  183.         [Limit2].[PhoneAfterHoursSupport] AS [PhoneAfterHoursSupport],
  184.         [Limit2].[Phone] AS [Phone],
  185.         [Limit2].[Preferred] AS [Preferred],
  186.         [Limit2].[ShopOnlineImageUrl] AS [ShopOnlineImageUrl],
  187.         [Limit2].[AdditionalInformationContentId] AS [AdditionalInformationContentId],
  188.         [Limit2].[AddressLine1ContentId] AS [AddressLine1ContentId],
  189.         [Limit2].[AddressLine2ContentId] AS [AddressLine2ContentId],
  190.         [Limit2].[CityContentId] AS [CityContentId],
  191.         [Limit2].[StateOrProvinceContentId] AS [StateOrProvinceContentId],
  192.         [Limit2].[NameContentId1] AS [NameContentId1],
  193.         [Limit2].[HoursOfOperationContentId] AS [HoursOfOperationContentId],
  194.         [Limit2].[WebsiteContentId] AS [WebsiteContentId],
  195.         [Limit2].[OnlineSellerHomePageUrlContentId] AS [OnlineSellerHomePageUrlContentId],
  196.         [Limit2].[ContactFormUrlContentId] AS [ContactFormUrlContentId],
  197.         [Limit2].[RequestAQuoteUrlContentId] AS [RequestAQuoteUrlContentId],
  198.         [Limit2].[NameContentId] AS [NameContentId2],
  199.         CAST(NULL AS uniqueidentifier) AS [C7],
  200.         CAST(NULL AS INT) AS [C8],
  201.         CAST(NULL AS INT) AS [C9],
  202.         CAST(NULL AS INT) AS [C10],
  203.         CAST(NULL AS VARCHAR(1)) AS [C11],
  204.         CAST(NULL AS INT) AS [C12],
  205.         CAST(NULL AS VARCHAR(1)) AS [C13],
  206.         [Extent24].[CategoryId] AS [CategoryId],
  207.         [Extent24].[CategoryId] AS [CategoryId1],
  208.         CAST(NULL AS INT) AS [C14],
  209.         CAST(NULL AS INT) AS [C15],
  210.         CAST(NULL AS INT) AS [C16],
  211.         CAST(NULL AS VARCHAR(1)) AS [C17],
  212.         CAST(NULL AS VARCHAR(1)) AS [C18],
  213.         CAST(NULL AS INT) AS [C19]
  214.         FROM   (SELECT [Project19].[Id] AS [Id], [Project19].[Disabled] AS [Disabled], [Project19].[NameContentId] AS [NameContentId], [Project19].[AddressLine1ContentId] AS [AddressLine1ContentId], [Project19].[AddressLine2ContentId] AS [AddressLine2ContentId], [Project19].[CityContentId] AS [CityContentId], [Project19].[StateOrProvinceContentId] AS [StateOrProvinceContentId], [Project19].[HoursOfOperationContentId] AS [HoursOfOperationContentId], [Project19].[AdditionalInformationContentId] AS [AdditionalInformationContentId], [Project19].[WebsiteContentId] AS [WebsiteContentId], [Project19].[ContactFormUrlContentId] AS [ContactFormUrlContentId], [Project19].[RequestAQuoteUrlContentId] AS [RequestAQuoteUrlContentId], [Project19].[OnlineSellerHomePageUrlContentId] AS [OnlineSellerHomePageUrlContentId], [Project19].[PostalCode] AS [PostalCode], [Project19].[Email] AS [Email], [Project19].[Phone] AS [Phone], [Project19].[PhoneAfterHoursSupport] AS [PhoneAfterHoursSupport], [Project19].[PhoneSales] AS [PhoneSales], [Project19].[PhoneSupport] AS [PhoneSupport], [Project19].[Fax] AS [Fax], [Project19].[Preferred] AS [Preferred], [Project19].[ShopOnlineImageUrl] AS [ShopOnlineImageUrl], [Project19].[IsoCountryCode] AS [IsoCountryCode], [Project19].[NameContentId1] AS [NameContentId1], [Project19].[C1] AS [C1], [Project19].[C2] AS [C2], [Project19].[C3] AS [C3], [Project19].[C4] AS [C4]
  215.             FROM ( SELECT
  216.                 [Extent14].[Id] AS [Id],
  217.                 [Extent14].[Disabled] AS [Disabled],
  218.                 [Extent14].[NameContentId] AS [NameContentId],
  219.                 [Extent14].[AddressLine1ContentId] AS [AddressLine1ContentId],
  220.                 [Extent14].[AddressLine2ContentId] AS [AddressLine2ContentId],
  221.                 [Extent14].[CityContentId] AS [CityContentId],
  222.                 [Extent14].[StateOrProvinceContentId] AS [StateOrProvinceContentId],
  223.                 [Extent14].[HoursOfOperationContentId] AS [HoursOfOperationContentId],
  224.                 [Extent14].[AdditionalInformationContentId] AS [AdditionalInformationContentId],
  225.                 [Extent14].[WebsiteContentId] AS [WebsiteContentId],
  226.                 [Extent14].[ContactFormUrlContentId] AS [ContactFormUrlContentId],
  227.                 [Extent14].[RequestAQuoteUrlContentId] AS [RequestAQuoteUrlContentId],
  228.                 [Extent14].[OnlineSellerHomePageUrlContentId] AS [OnlineSellerHomePageUrlContentId],
  229.                 [Extent14].[PostalCode] AS [PostalCode],
  230.                 [Extent14].[Email] AS [Email],
  231.                 [Extent14].[Phone] AS [Phone],
  232.                 [Extent14].[PhoneAfterHoursSupport] AS [PhoneAfterHoursSupport],
  233.                 [Extent14].[PhoneSales] AS [PhoneSales],
  234.                 [Extent14].[PhoneSupport] AS [PhoneSupport],
  235.                 [Extent14].[Fax] AS [Fax],
  236.                 [Extent14].[Preferred] AS [Preferred],
  237.                 [Extent14].[ShopOnlineImageUrl] AS [ShopOnlineImageUrl],
  238.                 [Extent15].[IsoCountryCode] AS [IsoCountryCode],
  239.                 [Extent15].[NameContentId] AS [NameContentId1],
  240.                 CASE WHEN ([Extent14].[Coordinates] IS NOT NULL) THEN [Extent14].[Coordinates].Lat ELSE CAST(0 AS FLOAT(53)) END AS [C1],
  241.                 CASE WHEN ([Extent14].[Coordinates] IS NOT NULL) THEN [Extent14].[Coordinates].Long ELSE CAST(0 AS FLOAT(53)) END AS [C2],
  242.                 CASE WHEN ((@p__linq__7 IS NOT NULL) AND ([Extent14].[Coordinates] IS NOT NULL)) THEN (@p__linq__8.STDistance([Extent14].[Coordinates])) * @p__linq__9 ELSE CAST(0 AS FLOAT(53)) END AS [C3],
  243.                 CASE WHEN ([Extent14].[Preferred] <> 1) THEN CAST(1 AS bit) WHEN ([Extent14].[Preferred] = 1) THEN CAST(0 AS bit) END AS [C4]
  244.                 FROM  [dbo].[Contact] AS [Extent14]
  245.                 LEFT OUTER JOIN [dbo].[Country] AS [Extent15] ON [Extent14].[IsoCountryCode] = [Extent15].[IsoCountryCode]
  246.                 WHERE ([Extent14].[Disabled] = @p__linq__0) AND ( EXISTS (SELECT
  247.                     1 AS [C1]
  248.                     FROM [dbo].[ContactBrands] AS [Extent16]
  249.                     WHERE ([Extent14].[Id] = [Extent16].[ContactId]) AND ([Extent16].[BrandId] IN (57))
  250.                 )) AND ( EXISTS (SELECT
  251.                     1 AS [C1]
  252.                     FROM [dbo].[ContactToContactType] AS [Extent17]
  253.                     WHERE ([Extent14].[Id] = [Extent17].[ContactId]) AND ([Extent17].[ContactTypeId] IN (6))
  254.                 )) AND ( EXISTS (SELECT
  255.                     1 AS [C1]
  256.                     FROM  [dbo].[ContactToContactType] AS [Extent18]
  257.                     INNER JOIN [dbo].[ContactType] AS [Extent19] ON [Extent19].[Id] = [Extent18].[ContactTypeId]
  258.                     WHERE ([Extent14].[Id] = [Extent18].[ContactId]) AND ([Extent19].[ConnectWithId] = @p__linq__1)
  259.                 )) AND ((([Extent14].[HasSpecialCoverage] <> 1) AND ((@p__linq__2.STDistance([Extent14].[Coordinates])) <= @p__linq__3)) OR ((( EXISTS (SELECT
  260.                     1 AS [C1]
  261.                     FROM  [dbo].[ContactCountiesOfCoverage] AS [Extent20]
  262.                     INNER JOIN [dbo].[County] AS [Extent21] ON [Extent21].[Id] = [Extent20].[CountyId]
  263.                     WHERE ([Extent14].[Id] = [Extent20].[ContactId]) AND (([Extent21].[Name] = @p__linq__4) OR (([Extent21].[Name] IS NULL) AND (@p__linq__4 IS NULL))) AND (([Extent21].[IsoStateCode] = @p__linq__5) OR (([Extent21].[IsoStateCode] IS NULL) AND (@p__linq__5 IS NULL)))
  264.                 )) OR ( EXISTS (SELECT
  265.                     1 AS [C1]
  266.                     FROM [dbo].[ContactStatesOfCoverage] AS [Extent22]
  267.                     WHERE ([Extent14].[Id] = [Extent22].[ContactId]) AND ([Extent22].[IsoStateCode] = @p__linq__6)
  268.                 )) OR ( EXISTS (SELECT
  269.                     1 AS [C1]
  270.                     FROM ( SELECT
  271.                         N'US' AS [C1]
  272.                         FROM  ( SELECT 1 AS X ) AS [SingleRowTable2]
  273.                     )  AS [Project16]
  274.                     WHERE  EXISTS (SELECT
  275.                         1 AS [C1]
  276.                         FROM [dbo].[ContactCountriesOfCoverage] AS [Extent23]
  277.                         WHERE ([Extent14].[Id] = [Extent23].[ContactId]) AND ([Extent23].[IsoCountryCode] = [Project16].[C1])
  278.                     )
  279.                 ))) AND ([Extent14].[HasSpecialCoverage] = 1)))
  280.             )  AS [Project19]
  281.             ORDER BY ROW_NUMBER() OVER (ORDER BY [Project19].[C4] ASC, [Project19].[C3] ASC)
  282.             OFFSET 0 ROWS FETCH NEXT 25 ROWS ONLY  ) AS [Limit2]
  283.         INNER JOIN [dbo].[ContactCategories] AS [Extent24] ON [Limit2].[Id] = [Extent24].[ContactId]
  284.     UNION ALL
  285.         SELECT
  286.         3 AS [C1],
  287.         [Limit3].[C4] AS [C2],
  288.         [Limit3].[C3] AS [C3],
  289.         [Limit3].[IsoCountryCode] AS [IsoCountryCode],
  290.         [Limit3].[NameContentId] AS [NameContentId],
  291.         [Limit3].[Disabled] AS [Disabled],
  292.         [Limit3].[Email] AS [Email],
  293.         [Limit3].[Fax] AS [Fax],
  294.         [Limit3].[Id] AS [Id],
  295.         [Limit3].[C1] AS [C4],
  296.         [Limit3].[C2] AS [C5],
  297.         [Limit3].[C3] AS [C6],
  298.         [Limit3].[PostalCode] AS [PostalCode],
  299.         [Limit3].[PhoneSupport] AS [PhoneSupport],
  300.         [Limit3].[PhoneSales] AS [PhoneSales],
  301.         [Limit3].[PhoneAfterHoursSupport] AS [PhoneAfterHoursSupport],
  302.         [Limit3].[Phone] AS [Phone],
  303.         [Limit3].[Preferred] AS [Preferred],
  304.         [Limit3].[ShopOnlineImageUrl] AS [ShopOnlineImageUrl],
  305.         [Limit3].[AdditionalInformationContentId] AS [AdditionalInformationContentId],
  306.         [Limit3].[AddressLine1ContentId] AS [AddressLine1ContentId],
  307.         [Limit3].[AddressLine2ContentId] AS [AddressLine2ContentId],
  308.         [Limit3].[CityContentId] AS [CityContentId],
  309.         [Limit3].[StateOrProvinceContentId] AS [StateOrProvinceContentId],
  310.         [Limit3].[NameContentId1] AS [NameContentId1],
  311.         [Limit3].[HoursOfOperationContentId] AS [HoursOfOperationContentId],
  312.         [Limit3].[WebsiteContentId] AS [WebsiteContentId],
  313.         [Limit3].[OnlineSellerHomePageUrlContentId] AS [OnlineSellerHomePageUrlContentId],
  314.         [Limit3].[ContactFormUrlContentId] AS [ContactFormUrlContentId],
  315.         [Limit3].[RequestAQuoteUrlContentId] AS [RequestAQuoteUrlContentId],
  316.         [Limit3].[NameContentId] AS [NameContentId2],
  317.         CAST(NULL AS uniqueidentifier) AS [C7],
  318.         CAST(NULL AS INT) AS [C8],
  319.         CAST(NULL AS INT) AS [C9],
  320.         CAST(NULL AS INT) AS [C10],
  321.         CAST(NULL AS VARCHAR(1)) AS [C11],
  322.         CAST(NULL AS INT) AS [C12],
  323.         CAST(NULL AS VARCHAR(1)) AS [C13],
  324.         CAST(NULL AS INT) AS [C14],
  325.         CAST(NULL AS INT) AS [C15],
  326.         [Extent35].[ContactTypeId] AS [ContactTypeId],
  327.         [Extent35].[ContactTypeId] AS [ContactTypeId1],
  328.         CAST(NULL AS INT) AS [C16],
  329.         CAST(NULL AS VARCHAR(1)) AS [C17],
  330.         CAST(NULL AS VARCHAR(1)) AS [C18],
  331.         CAST(NULL AS INT) AS [C19]
  332.         FROM   (SELECT [Project29].[Id] AS [Id], [Project29].[Disabled] AS [Disabled], [Project29].[NameContentId] AS [NameContentId], [Project29].[AddressLine1ContentId] AS [AddressLine1ContentId], [Project29].[AddressLine2ContentId] AS [AddressLine2ContentId], [Project29].[CityContentId] AS [CityContentId], [Project29].[StateOrProvinceContentId] AS [StateOrProvinceContentId], [Project29].[HoursOfOperationContentId] AS [HoursOfOperationContentId], [Project29].[AdditionalInformationContentId] AS [AdditionalInformationContentId], [Project29].[WebsiteContentId] AS [WebsiteContentId], [Project29].[ContactFormUrlContentId] AS [ContactFormUrlContentId], [Project29].[RequestAQuoteUrlContentId] AS [RequestAQuoteUrlContentId], [Project29].[OnlineSellerHomePageUrlContentId] AS [OnlineSellerHomePageUrlContentId], [Project29].[PostalCode] AS [PostalCode], [Project29].[Email] AS [Email], [Project29].[Phone] AS [Phone], [Project29].[PhoneAfterHoursSupport] AS [PhoneAfterHoursSupport], [Project29].[PhoneSales] AS [PhoneSales], [Project29].[PhoneSupport] AS [PhoneSupport], [Project29].[Fax] AS [Fax], [Project29].[Preferred] AS [Preferred], [Project29].[ShopOnlineImageUrl] AS [ShopOnlineImageUrl], [Project29].[IsoCountryCode] AS [IsoCountryCode], [Project29].[NameContentId1] AS [NameContentId1], [Project29].[C1] AS [C1], [Project29].[C2] AS [C2], [Project29].[C3] AS [C3], [Project29].[C4] AS [C4]
  333.             FROM ( SELECT
  334.                 [Extent25].[Id] AS [Id],
  335.                 [Extent25].[Disabled] AS [Disabled],
  336.                 [Extent25].[NameContentId] AS [NameContentId],
  337.                 [Extent25].[AddressLine1ContentId] AS [AddressLine1ContentId],
  338.                 [Extent25].[AddressLine2ContentId] AS [AddressLine2ContentId],
  339.                 [Extent25].[CityContentId] AS [CityContentId],
  340.                 [Extent25].[StateOrProvinceContentId] AS [StateOrProvinceContentId],
  341.                 [Extent25].[HoursOfOperationContentId] AS [HoursOfOperationContentId],
  342.                 [Extent25].[AdditionalInformationContentId] AS [AdditionalInformationContentId],
  343.                 [Extent25].[WebsiteContentId] AS [WebsiteContentId],
  344.                 [Extent25].[ContactFormUrlContentId] AS [ContactFormUrlContentId],
  345.                 [Extent25].[RequestAQuoteUrlContentId] AS [RequestAQuoteUrlContentId],
  346.                 [Extent25].[OnlineSellerHomePageUrlContentId] AS [OnlineSellerHomePageUrlContentId],
  347.                 [Extent25].[PostalCode] AS [PostalCode],
  348.                 [Extent25].[Email] AS [Email],
  349.                 [Extent25].[Phone] AS [Phone],
  350.                 [Extent25].[PhoneAfterHoursSupport] AS [PhoneAfterHoursSupport],
  351.                 [Extent25].[PhoneSales] AS [PhoneSales],
  352.                 [Extent25].[PhoneSupport] AS [PhoneSupport],
  353.                 [Extent25].[Fax] AS [Fax],
  354.                 [Extent25].[Preferred] AS [Preferred],
  355.                 [Extent25].[ShopOnlineImageUrl] AS [ShopOnlineImageUrl],
  356.                 [Extent26].[IsoCountryCode] AS [IsoCountryCode],
  357.                 [Extent26].[NameContentId] AS [NameContentId1],
  358.                 CASE WHEN ([Extent25].[Coordinates] IS NOT NULL) THEN [Extent25].[Coordinates].Lat ELSE CAST(0 AS FLOAT(53)) END AS [C1],
  359.                 CASE WHEN ([Extent25].[Coordinates] IS NOT NULL) THEN [Extent25].[Coordinates].Long ELSE CAST(0 AS FLOAT(53)) END AS [C2],
  360.                 CASE WHEN ((@p__linq__7 IS NOT NULL) AND ([Extent25].[Coordinates] IS NOT NULL)) THEN (@p__linq__8.STDistance([Extent25].[Coordinates])) * @p__linq__9 ELSE CAST(0 AS FLOAT(53)) END AS [C3],
  361.                 CASE WHEN ([Extent25].[Preferred] <> 1) THEN CAST(1 AS bit) WHEN ([Extent25].[Preferred] = 1) THEN CAST(0 AS bit) END AS [C4]
  362.                 FROM  [dbo].[Contact] AS [Extent25]
  363.                 LEFT OUTER JOIN [dbo].[Country] AS [Extent26] ON [Extent25].[IsoCountryCode] = [Extent26].[IsoCountryCode]
  364.                 WHERE ([Extent25].[Disabled] = @p__linq__0) AND ( EXISTS (SELECT
  365.                     1 AS [C1]
  366.                     FROM [dbo].[ContactBrands] AS [Extent27]
  367.                     WHERE ([Extent25].[Id] = [Extent27].[ContactId]) AND ([Extent27].[BrandId] IN (57))
  368.                 )) AND ( EXISTS (SELECT
  369.                     1 AS [C1]
  370.                     FROM [dbo].[ContactToContactType] AS [Extent28]
  371.                     WHERE ([Extent25].[Id] = [Extent28].[ContactId]) AND ([Extent28].[ContactTypeId] IN (6))
  372.                 )) AND ( EXISTS (SELECT
  373.                     1 AS [C1]
  374.                     FROM  [dbo].[ContactToContactType] AS [Extent29]
  375.                     INNER JOIN [dbo].[ContactType] AS [Extent30] ON [Extent30].[Id] = [Extent29].[ContactTypeId]
  376.                     WHERE ([Extent25].[Id] = [Extent29].[ContactId]) AND ([Extent30].[ConnectWithId] = @p__linq__1)
  377.                 )) AND ((([Extent25].[HasSpecialCoverage] <> 1) AND ((@p__linq__2.STDistance([Extent25].[Coordinates])) <= @p__linq__3)) OR ((( EXISTS (SELECT
  378.                     1 AS [C1]
  379.                     FROM  [dbo].[ContactCountiesOfCoverage] AS [Extent31]
  380.                     INNER JOIN [dbo].[County] AS [Extent32] ON [Extent32].[Id] = [Extent31].[CountyId]
  381.                     WHERE ([Extent25].[Id] = [Extent31].[ContactId]) AND (([Extent32].[Name] = @p__linq__4) OR (([Extent32].[Name] IS NULL) AND (@p__linq__4 IS NULL))) AND (([Extent32].[IsoStateCode] = @p__linq__5) OR (([Extent32].[IsoStateCode] IS NULL) AND (@p__linq__5 IS NULL)))
  382.                 )) OR ( EXISTS (SELECT
  383.                     1 AS [C1]
  384.                     FROM [dbo].[ContactStatesOfCoverage] AS [Extent33]
  385.                     WHERE ([Extent25].[Id] = [Extent33].[ContactId]) AND ([Extent33].[IsoStateCode] = @p__linq__6)
  386.                 )) OR ( EXISTS (SELECT
  387.                     1 AS [C1]
  388.                     FROM ( SELECT
  389.                         N'US' AS [C1]
  390.                         FROM  ( SELECT 1 AS X ) AS [SingleRowTable3]
  391.                     )  AS [Project26]
  392.                     WHERE  EXISTS (SELECT
  393.                         1 AS [C1]
  394.                         FROM [dbo].[ContactCountriesOfCoverage] AS [Extent34]
  395.                         WHERE ([Extent25].[Id] = [Extent34].[ContactId]) AND ([Extent34].[IsoCountryCode] = [Project26].[C1])
  396.                     )
  397.                 ))) AND ([Extent25].[HasSpecialCoverage] = 1)))
  398.             )  AS [Project29]
  399.             ORDER BY ROW_NUMBER() OVER (ORDER BY [Project29].[C4] ASC, [Project29].[C3] ASC)
  400.             OFFSET 0 ROWS FETCH NEXT 25 ROWS ONLY  ) AS [Limit3]
  401.         INNER JOIN [dbo].[ContactToContactType] AS [Extent35] ON [Limit3].[Id] = [Extent35].[ContactId]
  402.     UNION ALL
  403.         SELECT
  404.         4 AS [C1],
  405.         [Limit4].[C4] AS [C2],
  406.         [Limit4].[C3] AS [C3],
  407.         [Limit4].[IsoCountryCode] AS [IsoCountryCode],
  408.         [Limit4].[NameContentId] AS [NameContentId],
  409.         [Limit4].[Disabled] AS [Disabled],
  410.         [Limit4].[Email] AS [Email],
  411.         [Limit4].[Fax] AS [Fax],
  412.         [Limit4].[Id] AS [Id],
  413.         [Limit4].[C1] AS [C4],
  414.         [Limit4].[C2] AS [C5],
  415.         [Limit4].[C3] AS [C6],
  416.         [Limit4].[PostalCode] AS [PostalCode],
  417.         [Limit4].[PhoneSupport] AS [PhoneSupport],
  418.         [Limit4].[PhoneSales] AS [PhoneSales],
  419.         [Limit4].[PhoneAfterHoursSupport] AS [PhoneAfterHoursSupport],
  420.         [Limit4].[Phone] AS [Phone],
  421.         [Limit4].[Preferred] AS [Preferred],
  422.         [Limit4].[ShopOnlineImageUrl] AS [ShopOnlineImageUrl],
  423.         [Limit4].[AdditionalInformationContentId] AS [AdditionalInformationContentId],
  424.         [Limit4].[AddressLine1ContentId] AS [AddressLine1ContentId],
  425.         [Limit4].[AddressLine2ContentId] AS [AddressLine2ContentId],
  426.         [Limit4].[CityContentId] AS [CityContentId],
  427.         [Limit4].[StateOrProvinceContentId] AS [StateOrProvinceContentId],
  428.         [Limit4].[NameContentId1] AS [NameContentId1],
  429.         [Limit4].[HoursOfOperationContentId] AS [HoursOfOperationContentId],
  430.         [Limit4].[WebsiteContentId] AS [WebsiteContentId],
  431.         [Limit4].[OnlineSellerHomePageUrlContentId] AS [OnlineSellerHomePageUrlContentId],
  432.         [Limit4].[ContactFormUrlContentId] AS [ContactFormUrlContentId],
  433.         [Limit4].[RequestAQuoteUrlContentId] AS [RequestAQuoteUrlContentId],
  434.         [Limit4].[NameContentId] AS [NameContentId2],
  435.         CAST(NULL AS uniqueidentifier) AS [C7],
  436.         CAST(NULL AS INT) AS [C8],
  437.         CAST(NULL AS INT) AS [C9],
  438.         CAST(NULL AS INT) AS [C10],
  439.         CAST(NULL AS VARCHAR(1)) AS [C11],
  440.         CAST(NULL AS INT) AS [C12],
  441.         CAST(NULL AS VARCHAR(1)) AS [C13],
  442.         CAST(NULL AS INT) AS [C14],
  443.         CAST(NULL AS INT) AS [C15],
  444.         CAST(NULL AS INT) AS [C16],
  445.         CAST(NULL AS INT) AS [C17],
  446.         [Extent46].[MasterContentId] AS [MasterContentId],
  447.         [Extent46].[VALUE] AS [VALUE],
  448.         [Extent46].[IsoLanguageCode] AS [IsoLanguageCode],
  449.         [Extent46].[MasterContentId] AS [MasterContentId1]
  450.         FROM   (SELECT [Project39].[Id] AS [Id], [Project39].[Disabled] AS [Disabled], [Project39].[NameContentId] AS [NameContentId], [Project39].[AddressLine1ContentId] AS [AddressLine1ContentId], [Project39].[AddressLine2ContentId] AS [AddressLine2ContentId], [Project39].[CityContentId] AS [CityContentId], [Project39].[StateOrProvinceContentId] AS [StateOrProvinceContentId], [Project39].[HoursOfOperationContentId] AS [HoursOfOperationContentId], [Project39].[AdditionalInformationContentId] AS [AdditionalInformationContentId], [Project39].[WebsiteContentId] AS [WebsiteContentId], [Project39].[ContactFormUrlContentId] AS [ContactFormUrlContentId], [Project39].[RequestAQuoteUrlContentId] AS [RequestAQuoteUrlContentId], [Project39].[OnlineSellerHomePageUrlContentId] AS [OnlineSellerHomePageUrlContentId], [Project39].[PostalCode] AS [PostalCode], [Project39].[Email] AS [Email], [Project39].[Phone] AS [Phone], [Project39].[PhoneAfterHoursSupport] AS [PhoneAfterHoursSupport], [Project39].[PhoneSales] AS [PhoneSales], [Project39].[PhoneSupport] AS [PhoneSupport], [Project39].[Fax] AS [Fax], [Project39].[Preferred] AS [Preferred], [Project39].[ShopOnlineImageUrl] AS [ShopOnlineImageUrl], [Project39].[IsoCountryCode] AS [IsoCountryCode], [Project39].[NameContentId1] AS [NameContentId1], [Project39].[C1] AS [C1], [Project39].[C2] AS [C2], [Project39].[C3] AS [C3], [Project39].[C4] AS [C4]
  451.             FROM ( SELECT
  452.                 [Extent36].[Id] AS [Id],
  453.                 [Extent36].[Disabled] AS [Disabled],
  454.                 [Extent36].[NameContentId] AS [NameContentId],
  455.                 [Extent36].[AddressLine1ContentId] AS [AddressLine1ContentId],
  456.                 [Extent36].[AddressLine2ContentId] AS [AddressLine2ContentId],
  457.                 [Extent36].[CityContentId] AS [CityContentId],
  458.                 [Extent36].[StateOrProvinceContentId] AS [StateOrProvinceContentId],
  459.                 [Extent36].[HoursOfOperationContentId] AS [HoursOfOperationContentId],
  460.                 [Extent36].[AdditionalInformationContentId] AS [AdditionalInformationContentId],
  461.                 [Extent36].[WebsiteContentId] AS [WebsiteContentId],
  462.                 [Extent36].[ContactFormUrlContentId] AS [ContactFormUrlContentId],
  463.                 [Extent36].[RequestAQuoteUrlContentId] AS [RequestAQuoteUrlContentId],
  464.                 [Extent36].[OnlineSellerHomePageUrlContentId] AS [OnlineSellerHomePageUrlContentId],
  465.                 [Extent36].[PostalCode] AS [PostalCode],
  466.                 [Extent36].[Email] AS [Email],
  467.                 [Extent36].[Phone] AS [Phone],
  468.                 [Extent36].[PhoneAfterHoursSupport] AS [PhoneAfterHoursSupport],
  469.                 [Extent36].[PhoneSales] AS [PhoneSales],
  470.                 [Extent36].[PhoneSupport] AS [PhoneSupport],
  471.                 [Extent36].[Fax] AS [Fax],
  472.                 [Extent36].[Preferred] AS [Preferred],
  473.                 [Extent36].[ShopOnlineImageUrl] AS [ShopOnlineImageUrl],
  474.                 [Extent37].[IsoCountryCode] AS [IsoCountryCode],
  475.                 [Extent37].[NameContentId] AS [NameContentId1],
  476.                 CASE WHEN ([Extent36].[Coordinates] IS NOT NULL) THEN [Extent36].[Coordinates].Lat ELSE CAST(0 AS FLOAT(53)) END AS [C1],
  477.                 CASE WHEN ([Extent36].[Coordinates] IS NOT NULL) THEN [Extent36].[Coordinates].Long ELSE CAST(0 AS FLOAT(53)) END AS [C2],
  478.                 CASE WHEN ((@p__linq__7 IS NOT NULL) AND ([Extent36].[Coordinates] IS NOT NULL)) THEN (@p__linq__8.STDistance([Extent36].[Coordinates])) * @p__linq__9 ELSE CAST(0 AS FLOAT(53)) END AS [C3],
  479.                 CASE WHEN ([Extent36].[Preferred] <> 1) THEN CAST(1 AS bit) WHEN ([Extent36].[Preferred] = 1) THEN CAST(0 AS bit) END AS [C4]
  480.                 FROM  [dbo].[Contact] AS [Extent36]
  481.                 LEFT OUTER JOIN [dbo].[Country] AS [Extent37] ON [Extent36].[IsoCountryCode] = [Extent37].[IsoCountryCode]
  482.                 WHERE ([Extent36].[Disabled] = @p__linq__0) AND ( EXISTS (SELECT
  483.                     1 AS [C1]
  484.                     FROM [dbo].[ContactBrands] AS [Extent38]
  485.                     WHERE ([Extent36].[Id] = [Extent38].[ContactId]) AND ([Extent38].[BrandId] IN (57))
  486.                 )) AND ( EXISTS (SELECT
  487.                     1 AS [C1]
  488.                     FROM [dbo].[ContactToContactType] AS [Extent39]
  489.                     WHERE ([Extent36].[Id] = [Extent39].[ContactId]) AND ([Extent39].[ContactTypeId] IN (6))
  490.                 )) AND ( EXISTS (SELECT
  491.                     1 AS [C1]
  492.                     FROM  [dbo].[ContactToContactType] AS [Extent40]
  493.                     INNER JOIN [dbo].[ContactType] AS [Extent41] ON [Extent41].[Id] = [Extent40].[ContactTypeId]
  494.                     WHERE ([Extent36].[Id] = [Extent40].[ContactId]) AND ([Extent41].[ConnectWithId] = @p__linq__1)
  495.                 )) AND ((([Extent36].[HasSpecialCoverage] <> 1) AND ((@p__linq__2.STDistance([Extent36].[Coordinates])) <= @p__linq__3)) OR ((( EXISTS (SELECT
  496.                     1 AS [C1]
  497.                     FROM  [dbo].[ContactCountiesOfCoverage] AS [Extent42]
  498.                     INNER JOIN [dbo].[County] AS [Extent43] ON [Extent43].[Id] = [Extent42].[CountyId]
  499.                     WHERE ([Extent36].[Id] = [Extent42].[ContactId]) AND (([Extent43].[Name] = @p__linq__4) OR (([Extent43].[Name] IS NULL) AND (@p__linq__4 IS NULL))) AND (([Extent43].[IsoStateCode] = @p__linq__5) OR (([Extent43].[IsoStateCode] IS NULL) AND (@p__linq__5 IS NULL)))
  500.                 )) OR ( EXISTS (SELECT
  501.                     1 AS [C1]
  502.                     FROM [dbo].[ContactStatesOfCoverage] AS [Extent44]
  503.                     WHERE ([Extent36].[Id] = [Extent44].[ContactId]) AND ([Extent44].[IsoStateCode] = @p__linq__6)
  504.                 )) OR ( EXISTS (SELECT
  505.                     1 AS [C1]
  506.                     FROM ( SELECT
  507.                         N'US' AS [C1]
  508.                         FROM  ( SELECT 1 AS X ) AS [SingleRowTable4]
  509.                     )  AS [Project36]
  510.                     WHERE  EXISTS (SELECT
  511.                         1 AS [C1]
  512.                         FROM [dbo].[ContactCountriesOfCoverage] AS [Extent45]
  513.                         WHERE ([Extent36].[Id] = [Extent45].[ContactId]) AND ([Extent45].[IsoCountryCode] = [Project36].[C1])
  514.                     )
  515.                 ))) AND ([Extent36].[HasSpecialCoverage] = 1)))
  516.             )  AS [Project39]
  517.             ORDER BY ROW_NUMBER() OVER (ORDER BY [Project39].[C4] ASC, [Project39].[C3] ASC)
  518.             OFFSET 0 ROWS FETCH NEXT 25 ROWS ONLY  ) AS [Limit4]
  519.         INNER JOIN [dbo].[TranslatedContent] AS [Extent46] ON ([Limit4].[NameContentId] = [Extent46].[MasterContentId]) AND ([Extent46].[IsoLanguageCode] IN (@p__linq__10,N'en'))) AS [UnionAll3]
  520.     ORDER BY [UnionAll3].[C2] ASC, [UnionAll3].[C3] ASC, [UnionAll3].[IsoCountryCode] ASC, [UnionAll3].[Id] ASC, [UnionAll3].[C1] ASC, [UnionAll3].[ContactId] ASC, [UnionAll3].[BrandId] ASC, [UnionAll3].[Id1] ASC, [UnionAll3].[C7] ASC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement