I was wondering if I have a model class like this:
public class Contact
{
public string Name { get; set; }
public string[] Emails { get; set; }
}
In my View I use DisplayFor, so it does show all emails, but just as one string.
@Html.DisplayFor(modelItem => item.Emails)
[email protected]@[email protected]
Is there some kind of DisplayFormat attribute that I can apply to Emails property, so that it would display all emails for a single contact, separated by a comma, like this:
[email protected], [email protected], [email protected]
Dont really want to use foreach(var email in Model.Email) in my view for this simple operation.
Thanks.