skip to Main Content

C# LINQ to select element from string array – Asp.net

I have a string: private const string Codes = "2,10"; public void method() { var displayCodes = Codes.Split(','); DemoResponse response = webService.GetResponse(); //getting response from API if(response.Errors.Any(x => displayCodes.Contains(x.StackTrace)) { int myCode = int.Parse(response.Errors.Select(x => x.StackTrace).FirstOrDefault()); } } This is…

VIEW QUESTION

Take max date row from duplicates and remove duplicates in the list using linq – Asp.net

I have a below linq query and getting data like below example want to remove duplications List<EmployeeSalary> lstEmployeeSalary = new EmployeeSalaryFactory().GetRelatedObjects(inValue, ddlPayDate, payRollType, payrollSearch) .Select(m => (EmployeeSalary)m) .ToList(); For ex.: Id Name EmpCode Salary DateOfSalary ------------------------------------------------------------- 1 Item1 IT00001 $100…

VIEW QUESTION
Back To Top
Search