I have the following code where i'm trying to split a string and add it to my List of String. But i'm having trouble doing it like this:
List<string> filteredProviders = new List<string>();
foreach (Door2MoreLeadModel d2m in lstDoor2MoreLeadModel)
{
if(!string.IsNullOrEmpty(d2m.FilteredProviders))
{
filteredProviders.Add(d2m.FilteredProviders.Split(',')).ToList());
}
}
Getting following error:
The best overloaded method match for System.Collections.Generic.List.Add(string)' has some invalid arguments
What am I doing wrong?