I have 2 list, first one is a string list which I fill with Directory.GetFiles()
method and my second list is a custom one. I have only 2 fields in my custom list. First one is FilePath
second is UniqueID
..
What I try to achieve is, I want to compare the string list with my custom list's FilePath
field. I need to get the changes.
I've convert my Custom list to string and tried this solution Difference between two lists It worked perfect but in my case it's useless for me. I need to compare different type of lists
Here is my custom class that I'm using as model
public class IndexerListModel
{
public string FilePath = string.Empty;
public string uniqueID = string.Empty;
}
And this is how I tried it already
List<IndexerListModel> T3 = XMLList.Except(WinFileList, new PathComparer()).ToList();
But because I don't use the same type on my list's it did not worked.
I was expecting to get the difference like a new list that show me these "x" items inside your list have different Filepaths..
My overall goal is getting the changes in a windows folder on Application start. So I will know which files has been added/removed/changed/renamed while my application was not up