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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -