Solved

How to sort and filter using LINQ ?

Posted on 2013-11-12
1
352 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
ID: 39641857
var sortedEmps =        
from e in employeeDetail
        orderby e.Emp_Number.
        select e;
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
vb.net winforms sizing/resolution? 4 39
Function after success of Jquery/AJAX action 9 27
parsing JSON help 1 20
Syntax Issue with SSIS module 26 100
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used.

790 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