Otis wrote:
The problem with m:n relations in-memory is that there's a 3rd entity involved, the intermediate entity. That entity doesnt have to be loaded per-se, which means you can't save an m:n relation without the intermediate entities.
I tried an alternative approach with 1:m foreign keys as follows:
Person (table)
Name
FkAddressId
Address (table)
Street
FkCountryId
Country (table)
Name
dim p as PersonEntity = new PersonEntity
p.Name = "Bob"
p.Address.Street = "123 Lane"
p.Address.Country = "USA"
p.Save(true)
Address and Country are not saved though unless I explicitly assign a new AddressEntity and CountryEntity. Why is that? It seems like this should result in a recursive save even if the entities are new.