Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

how to check if List element contains an item with a Particular Property Value in c#

static List<Course> courses = new List<Course>()
        { 
            new Course() {CourseId = 1, CourseName="Android",Trainer="Shawn",Fees=12000},
            
            new Course() {CourseId = 2, CourseName="Asp.net",Trainer="Kevin",Fees=10000},

            new Course() {CourseId = 3, CourseName="Css",Trainer="Debaratha",Fees=15000},
            
            new Course() {CourseId = 4, CourseName="Html",Trainer="Mark John",Fees=10000}

        };
//find a perticular course name from the above list through lamda expression
IEnumerable<Course> ilist = courses.Where(c => c.CourseName == "Jsp");
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #check #element #item #Particular #Property #Value
ADD COMMENT
Topic
Name
1+8 =