I’ve looked this up an embarrassing number of times – here is how you do linq projection with the extension method syntax
List<TypeClassification> typeClassifications = ctx.Classes.Select(e => new TypeClassification() {Name = e.Name, TypeClassificationID = e.ClassificationID}).ToList();
Hopefully I shall remember. I’m not sure why I can’t remember the exact syntax.
|
Written By Steve French |
Leave a Reply