Skip to content

Latest commit

 

History

History
15 lines (13 loc) · 586 Bytes

README.md

File metadata and controls

15 lines (13 loc) · 586 Bytes

NiceLinq

The library contains two methods that I used to use whenever I thought of the IN and NOT IN operators in SQL, their implementations are simple but hides a repetive code. For example, if you want to get list of accounts fall in range of Ids, use it like this:

var selectedAccounts = listOfAccounts.In(x => x.Id, 1,2,3,4);
//this will get you a list of accounts whose Ids are 1,2,3,4

you also can pass a List<int> rather array of parameters:

List<int> ids = bank.GetAccountIds(1);
var selectedAccounts = listOfAccounts.In(x => x.Id, ids);