Solved

How to sort and filter using LINQ ?

Posted on 2013-11-12
1
347 Views
Last Modified: 2016-02-10
I have the below employee object with following  values.
How do I sort by Emp_Number    using LINQ ?
How to filter Designation      ='Manager' using  LINQ ?


        List<Employee>  employeeDetail= new List<Employee>();


Emp_Number            Name          Designation      salary
1                                   aa               Employee         30000
2                                   a1               Manager           60000
3                                    b1              Employee         35000
6                                   b2              Employee          32000
5                                   c1               Manager           40000
0
Comment
Question by:Varshini S
1 Comment
 
LVL 15

Accepted Solution

by:
unknown_routine earned 500 total points
Comment Utility
var sortedEmps =        
from e in employeeDetail
        orderby e.Emp_Number.
        select e;
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now