I wrote this SQL server select statement to only return 204 characters and append ... to the end if there was more than 204 chars in that row.
SELECT Name, Active, Image, CASE WHEN LEN(Description) <= 204 THEN Description ELSE LEFT (Description , 204) + '...' END AS 'Short Description' FROM Brands
How do I finish this linq code to do the same?
var query = db.Brands.Select(p=> new{
Brand =p,
p.Description.Length <-- I believe this is a starting point?>
});