My class inherits an interface so I need to have the emailaddress property in the Person class.
My question is what is the best way to get the property and set the property
public class Contact : IPerson, ILocation
{
...
[MaxLength(256)]
public string EmailAddress {
get{
return this.Emails.First().ToString();
}
set{ ???? }
}
....
public virtual ICollection<Emails> Emails { get; set; }
}
Essentially, I'm trying to get the class to allow more than one email.
For full disclosure, I'm pretty new to this and I may not be asking the correct questions, but I've searched for a day and half and haven't seen anything like this (not that I think it's unusual) and could use the insight.
Email class properties:
[Key]
public int Id { get; set; }
[MaxLength(256)]
public string EmailAddress { get; set; }