Two fields with the same name
- by H. Abraham Chavez
I have a ViewModel class to encapsulate "Personal" and "Business" models. My problem is that both models have a property called "Email" and the model binding is not able to make a distinction between the too.
I read that [Bind(Prefix = ... is used to resolved this issue, but I have not been able to see a concise example on how to achieve this.
SO community please help.
public class BusinessFormViewModel
{
public Business Business { get; set; }
public ContactPerson ContactPerson { get; set; }
public BusinessFromView(Business business, ContactPerson contactPerson)
{
Business = business;
ContactPerson = contactPerson;
}
}