i´m tryin to obtain data from one list that not in another list, the 2 list have the same data type, the two list are a list of Articles whith diferent data:
public class Articles
{
public string ArticleName{ get; set; }
public string ClientName { get; set; }
public DateTime Date { get; set; }
public string ProviderName { get; set; }
public string Seller{ get; set; }
public string ArticleCode { get; set; }
public float Price { get; set; }
public float Stock { get; set; }
public int MiniumUnit { get; set; }
}
List<Articles> LstLowRotation=new List<Articles>();
List<Articles> LstVeryLowRotation=new List<Articles>();
and then i add data in each list(some are differents) and then:
LstVeryLowRotation = LstVeryLowRotation.Where(x => !lstLowRotation.Any
(z => z.ArticleCode == x.ArticleCode)).ToList();
but not give me the expected result, they give me more articles that is suposed.
Any idea why don´t works?
also i try
LstVeryLowRotation.except(Lst.LowRotation)
I know is that supossed to work, i have tested with only a few data and works fine, but when i add the data from a datareader it does wrong, and the strangest thing is that when i run appears data that is not in one list or the other list, it´s supposed to be impossible!!!
I edited the names to be more clear.