Say I have the following Linq 2 SQL command;
ItemsRepository.All().Where(r => r.type == "myType");
Let’s say it returns an object collection of;
- id
- title
- description
- type
- etc
Is there a way to return the entire object and trim the description to the 1st 200 chrs if there are more than 200 chrs in the description?
Or should i get the collection and then itterate through them?
thanks
You could use Select to project that to a new collection. So you’d have –
If you don’t want to project to an anonymous type, just specify the type you wish to project to –