My Database Table structure:
Schema Property Type
For different 'Schema' values I have same 'Property' and 'Type' values.
My linq query:
IEnumerable<CModel> model = db.dbModels.AsEnumerable().Select(o => new CModel { CName = "XXX", PName = o.Property, PType = o.Type }).Distinct().ToList();
What I'm trying to do is get distinct 'Property' and 'Type' values but the query is giving me duplicate values.
Thanks
PropertyandType? If they are simple types like string or int this query should produce distinct results. And what's the use of thisAsEnumerable()?