I need to seed my Data using a one to many relationship ( A contact can have many addresses) But it wont let me seed Addresses that i specified as an ICollection. I cant store it as a string or int. so what do i do?
namespace SuccessEd.Data.Model
{
public class Contact
{
public int ContactId { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
public virtual ICollection<Address> Addresses { get; set; }
}
}
namespace SuccessEd.Data.Model
{
public class Address
{
public int AddressId { get; set; }
public string HomeAddress { get; set; }
public string BusinessAddress { get; set; }
public string PoBox { get; set; }
public int ContactId { get; set; }
public virtual Contact Contact { get; set; }
}