70-516 · Question #195
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework. The application has an entity model that contains a SalesOrderHeader…
The correct answer is C. var model = new AdventureWorksEntities(). OrderBy() Sorts the elements of a sequence in ascending order according to a key. OrderByDescending() Sorts the elements of a sequence in descending order according to a key. Enumerable.OrderBy<TSource, TKey> Method (IEnumerable<TSource>, Func<TSource, TKey>)
Question
You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4.0 to develop an application that uses the Entity Framework. The application has an entity model that contains a SalesOrderHeader entity. The entity includes an OrderDate property of type DateTime. You need to retrieve the 10 oldest SalesOrderHeaders according to the OrderDate property. Which code segment should you use?
Options
- Avar model = new AdventureWorksEntities();
- Bvar model = new AdventureWorksEntities();
- Cvar model = new AdventureWorksEntities();
- Dvar model = new AdventureWorksEntities();
How the community answered
(46 responses)- A4% (2)
- B9% (4)
- C85% (39)
- D2% (1)
Explanation
OrderBy() Sorts the elements of a sequence in ascending order according to a key. OrderByDescending() Sorts the elements of a sequence in descending order according to a key. Enumerable.OrderBy<TSource, TKey> Method (IEnumerable<TSource>, Func<TSource, TKey>)
Topics
Community Discussion
No community discussion yet for this question.