Relation to the Country Class in the Travel Class

Now the Travel class needs a reference to the Country class and a property for public access:

[NDORelation]

List<Country> countries = new List<Country>();

public void AddCountry(Country l)

{

    countries.Add(l);

}

public void RemoveCountry(Country l)

{

    countries.Remove(l);

}

public IEnumerable<Country> Countries

{

    get { return countries; }

    set { countries = value.ToList(); }

}

Again, this is not a composite relation.

Don’t forget to adapt the database with the SQL script after rebuilding the assemblies.