I have a list AllIDs.List<IAddress> AllIDs = new List<IAddress>();I want to to substring operation on a member field AddressId based on a character "_".
I am using below LINQ query but getting compilation error:
AllIDs= AllIDs.Where(s => s.AddressId.Length >= s.AddressId.IndexOf("_")).Select(s => s.AddressId.Substring(s.AddressId.IndexOf("_"))).ToList();
Error:
Cannot implicitly convert type 'System.Collections.Generic.List<string>' to 'System.Collections.Generic.List<MyCompany.Common.Users.IAddress>'