2
Answers

LINQ Query

What's wrong in my Linq expression:-

 List<FocusArea> filteredListOfFocusAreas = new List<FocusArea>();

                    foreach(var segment1 in  segment1Value.Split(';'))
                    {
                        var segment1DBValue = 1; //Fetch mapped value from DB in INT
                        foreach(var segment2 in segment2Value.Split(';')){
                            var segment2DBValue = 1; //Fetch mapped value from DB in INT
                            filteredListOfFocusAreas.Add(listOfFocusAreas.Where(fa => fa.Segment1 == segment1DBValue && fa.Segment2 == segment2DBValue && fa.Segment3 == 0));
                        }
                    }

Answers (2)