New Posts New Posts RSS Feed: how can I sort the entities from 'B' to 'D'?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

how can I sort the entities from 'B' to 'D'?

 Post Reply Post Reply
Author
GregD View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 374
Post Options Post Options   Quote GregD Quote  Post ReplyReply Direct Link To This Post Topic: how can I sort the entities from 'B' to 'D'?
    Posted: 16-Jul-2009 at 11:55am
Two ways:
 
     manager.Debtors.Where(o => o.L_NAME.StartsWith("B") || o.L_NAME.StartsWith(C") || o.L_NAME.StartsWith("D") )
 
or more succinctly (better for a large set):
 
     manager.Debtors.Where(o => "BCD".Contains(o.L_NAME.Substring(0, 1)))
Back to Top
monkeyking View Drop Down
Groupie
Groupie
Avatar

Joined: 04-Mar-2009
Location: brisbane
Posts: 68
Post Options Post Options   Quote monkeyking Quote  Post ReplyReply Direct Link To This Post Posted: 10-Jul-2009 at 11:26pm
I want to make query to find out all 'Debtor' entities which the property of 'L_NAME' from 'B' to 'D', how can I do it?

sth like that,

var query = AdditionalFunctions.manager.Debtors.Where(o => o.L_NAME >= 'B' && o.L_NAME <= 'D');

but actually this line of code doesn't work, if you get my mean, please let me know a correct way to achieve this

Regards
John
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down