Return to Snippet

Revision: 34956
at October 31, 2010 05:10 by housecor


Initial Code
var query = from m in db.TeamMembers
						orderby m.Name
						select new {  
							Photo = m.Photo ?? "default.jpg", 
							Modified = String.Format("{0:M/d/yyyy}", m.Modified), 
							Created = String.Format("{0:M/d/yyyy}", m.Created) 
						};

Initial URL

                                

Initial Description

                                

Initial Title
LINQ COALESCE to provide conditional when value is null in Anonymous type

Initial Tags

                                

Initial Language
C#