Quantcast
Channel: This code returns distinct values. However, what I want is to return a strongly typed collection as opposed to an anonymous type - Stack Overflow
Viewing all articles
Browse latest Browse all 8

Answer by Thebigcheeze for This code returns distinct values. However, what I want is to return a strongly typed collection as opposed to an anonymous type

$
0
0

Should be as simple as:

var foo = (from data in pivotedData.AsEnumerable()               select new               {                 Group = data.Field<string>("Group_Number"),                 Study = data.Field<string>("Study_Name")               }).Distinct().Select(x => new BarObject {                 Group = x.Group,                 Study = x.Study               });

Viewing all articles
Browse latest Browse all 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>