When analyzing some ASP.NET MVC projects, I had to see anonymous types scattered around the world.
HTML Helpers:
<%=Html.TextBox("view.Address", "address", new { Class = "text_field" })%>
Many types of return actions for them have:
JsonNetResult jsonNetResult = new JsonNetResult
{
Formatting = Formatting.Indented,
Data = new {Something= ""}
}
I know this came from LINQ:
from p in context.Data
select new { p.Name, p.Age };
Are they really the right ways to accomplish the tasks that are now beyond LINQ? Do they enhance code reuse and readability?
source
share