I have a linq statement that needs to read through a text file. It takes alist of urls and strips them back to get the domains. I then want to take the unique domains and write them back out to a file.
Here's what I have so far:
var urls = File.ReadAllLines(badLinks)
.Where(x => x.IsNotNullOrEmpty())
.Select(x => ManipulateUrl(x))
.Distinct()
.ToList();
The thing is, I've noticed that Distinct() function only includes a domain if the manipluated entry is Distinct when I really re-evaluate the list after the changes and create a list of unique enties (domains).
Any help appreciated.
* UPDATE *
Sorry guys, after breaking down the list it turns out that the source file has the problem. Was difficult to see with 100k records in.