Query Expression-Anweisung
In dem folgenden Beispiel werden alle CountryRegion-Datensätze als Resultat zurückgeliefert, die der CountryRegionCode mit der Buchstabe A anfangen.
IQueryable
where cr.CountryRegionCode.StartsWith("A")
select cr;
SQL-Anweisung
In der SQL-Anweisung sehen Sie den LIKE mit dem Parametre @p0, welches den Wert A% zugewiesen wird.
SELECT [t0].[CountryRegionCode], [t0].[Name], [t0].[ModifiedDate]
FROM [Person].[CountryRegion] AS [t0]
WHERE [t0].[CountryRegionCode] LIKE @p0
-- @p0: Input String (Size = 2; Prec = 0; Scale = 0) [A%]
-- Context: SqlProvider(Sql2005) Model: AttributedMetaModel Build: 3.5.20706.1
Lambda Expression-Anweisung
IQueryable
.Where(cr => cr.CountryRegionCode.StartsWith("A"));
No comments:
Post a Comment