开发者

Many-to-many relationship in .NET RIA services

开发者 https://www.devze.com 2022-12-12 04:53 出处:网络
I have a many-to-many relationship in my database of objects A to B. When i create a domain service the metadata looks fine. A has a collections of Bs, B has a collection of As. So it is correct. Howe

I have a many-to-many relationship in my database of objects A to B. When i create a domain service the metadata looks fine. A has a collections of Bs, B has a collection of As. So it is correct. However the *.g.cs file generated doesn't have the same relationship.

Is there a way to make it work? I googled some answer to actually generate o开发者_如何学Pythonbjects for the association table but i am curious if i can avoid this.

Thanks


In the current release/version of RIA Services, you'll need the association table. We will most definitely be looking into this of course for a future release.

That said, I think often many-to-many relationships often have some interesting data associated with the relationship and as such, the middle table often has a real use, rather than existing for the sake of existing.


Till MS implements it in RIA, you can use http://m2m4ria.codeplex.com/ We have used in one of our Silverlight/RIA projects for User/Role (many-to-many) relationship and worked fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消