how to make OrderBy() available to domain model

0 views
Skip to first unread message

Kit

unread,
Jul 4, 2009, 12:30:06 PM7/4/09
to S#arp Architecture
Dear all,

I am developing a model similar to the "Emloyee" and "Territories" in
the most update trunk.

I generated my models using ScaffoldingGeneratorCommand.tt.

However I find some difference between my model and northwind.

in EmployeesController.cs, Line 160


viewModel.AvailableTerritories =
territoriesRepository.GetAll().OrderBy(territory
=> territory.Description).ToList();

There is OrderBy() in the IList returned by
territoriesRepository.GetAll().

May I know how I can have the OrderBy() ? I believe I must have
missing some interface in my model or something else.

Thanks a lot for any help.
Regards,
Kit

tom

unread,
Jul 4, 2009, 12:45:35 PM7/4/09
to S#arp Architecture
The OrderBy method is a LINQ extension for collections.

http://msdn.microsoft.com/en-us/library/system.linq.enumerable.orderby.aspx
Reply all
Reply to author
Forward
0 new messages