asp.net - How to sort a list in alphabetic order and pick certain range of characters from Entity Framework list? -
i have list of records. , want pick subset of list respect starting character. list contains elements , want pick elements of range it. example list has records starting characters, - z, want pick records a-j, how can in entity framework list. dont want use linq want use entity functions.
for example
objectset.where(p=>p.name starts , j)
thanks in advance.
try like
from c in contacts "abcdefghijkl".contains(c.lastname.substring(0, 1)) select c
it issue sql like
select [extent1].[id] [id], [extent1].[firstname] [firstname], [extent1].[lastname] [lastname] ( cast(charindex(substring([extent1].[lastname], 0 + 1, 1), n'abcdefghijkl') int) ) > 0
Comments
Post a Comment