How does this evaluate, like, whats the flow,
This:
var tag = new TagBuilder("a");
tag.MergeAttribute("href", pageUrl(i));
tag.InnerHtml = i.ToString();
Can be turned into this:
var tag = new TagBuilder("a")
{
MergeAttribute("href", pageUrl(i)),
InnerHtml = i.ToString()
};
Does it go:
- Instastiates new object
- Parses the argument and sets it up
- Assigns all the values to the properties
Effectively does it mean the same thing, why and how?
Even if there was no "a"
being parsed, would it still instantiate the object and give all the property values their defaults?