This cannot be done using the built-in style editor. However, you can write an extension method that you call as follows:
void Main() { // AdventureWorks Contacts.Select (c => new { c.FirstName, c.LastName, NameStyle = c.NameStyle.RedBlue() }).Dump(); } static class Extensions { public static object RedBlue (this bool value) { string c = value ? "Blue" : "Red"; return Util.RawHtml ("<span style='color:" + c + "'>" + value + "</span>"); } }
If you put the extension method in the VS project and copy the DLL into the LINQPad plugins folder, it will be automatically available for all requests.
EDIT: Now you can define this method in the "My Extensions" query, rather than creating a project in VS.
source share