public people()
{
this.countries = new HashSet<countries>();
}
public long id { get; set; }
public string guid { get; set; }
public string full_name { get; set; }
public System.Date_birth DateTime { get; set; }
public string birthplace { get; set; }
public string birthplace_fias { get; set; }
public string sex { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadonly")]
public virtual ICollection<countries> countries { get; set; }
}</countries></countries>
public partial class countries
{
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public countries()
{
this.people = new HashSet<people>();
}
public int id { get; set; }
public string full_name { get; set; }
public string name { get; set; }
public string full_name_eng { get; set; }
public string name_eng { get; set; }
public string iso_num { get; set; }
public string iso2 { get; set; }
public string iso3 { get; set; }
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadonly")]
public virtual ICollection<people> people { get; set; }
}</people></people>
ICollection<countries> countries = new Collection<countries>();
countries.Add(new countries()
{
id = 182,
full_name = "Russia"
name = "Russia"
full_name_eng = "Russian Federation",
name_eng = "Russia"
iso_num = "643",
iso2 = "RU"
iso3 = "RUS"
});
peoplepdto = new people()
{
birthplace = "Ufa",
date_birth = DateTime.Today
full_name = "Ivanov Ivan Ivanovich",
guid = Guid.NewGuid().ToString(),
sex = "M",
countries = countries
};</countries></countries>
ICollection<countries> countries = _countriesRepository.Get(...);
peoplepdto people = new people()
{
birthplace = "Ufa",
date_birth = DateTime.Today
full_name = "Ivanov Ivan Ivanovich",
guid = Guid.NewGuid().ToString(),
sex = "M",
countries = countries
};</countries>
Find more questions by tags C#Entity Framework