This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have these tables in my DB and expected that the m:n relationship will be properly resolved: CREATE TABLE [dbo].[Episodes]( CREATE TABLE [dbo].[Categories]( ... CREATE TABLE [dbo].[Episode_Categories](
I expected Episode entity to have a Categories collection property (and vice versa). The EF designer resolved it, BTW ;)
Thanks, Christian |
|
|
Hi Christian, An expectation of LightSpeed is that each table has an Id field as a primary key (LightSpeed does not use composite keys). Please add an Id field to your intersection table and everything should be fine. There is also improved support for through associations in the designer in the most recent nightlies. Let me know if that resolves your issue :-) John-Daniel |
|
|
Hm, didn't help... |
|
|
The designer doesn't currently automatically infer intersection tables as through (many-to-many) associations. In current nightly builds, you can manually create the through association by dragging a ThroughAssociation arrow from Episode to Category. When you do this, the designer should automatically associate the ThroughAssociation with the intersection table. In some cases you can use an "automatic" through entity so as to avoid cluttering the diagram -- unfortunately in your case because the database table name (Episode_Categories) is different from the automatic class name (EpisodeCategories, without the underscore), you would need to keep the explicit through entity. We'll look at enhancing the inference around this pattern -- thanks for the feedback! |
|