I have a query with single result. The result is an anonymouse type. How can I use access the type so I don't have to use query.Single() every time?
This is my query:
var result = from row in db.Table
select new { CustomName = row.RowName };
This is how I use it right now:
string name = result.Single().CustomName;
Of course my real code has a lot more properties and for every property I have to call .Single() every time. Is there an easier way to access CustomName here?