Hi, I've just started to play around with DO.Net and wanted to create an one-to-one relationship between two classes (tables). Say, I have two entities, Course and price. A course can be linked to one or NO price. I want the key for price to be the CourseId. I don't want the course to have a foreign key to Price. So I created my model like this
I was expecting to have two tables in my DB, Course and Price, the primary key for Price being CourseId and no field referencing Price in Course table. However, after my domain is built, the table Course includes a field called 'Price.course'. So my question is, Is there any way of creating this mapping between Course and Price where only Price references Course in the database? I can accomplish this if I have an EntitySet<price> in Course, but I want only one price to be linked to Course. I've tried to use Association attribute, but I didn't succeed. Any help? Thanks |