locked
EF 4 & RIA Services RRS feed

  • Question

  • I'm using RIA Services and EF 4. All is working as of now. I trying to implement many-many with the use of a junction table. Have the dummy field so the junction tables shows in the designer. Put [Include] on the collections of the related properties of each entity. Reading a lot of the good forum content. But I'm not clear on a few topics. 1)when do you use Composition & Association compared to just using the [include]? 2)what is compostion? and do you use that with [include]? thank you
    Saturday, May 1, 2010 11:13 AM

Answers

  • The association tag is automatically generated for Entity Framework and LINQ to SQL. When using POCOs or other alternate DALs you need to create the tag yourself. Having the include without an association will not do anything.

    Here is information about composition: http://blogs.msdn.com/digital_ruminations/archive/2009/11/18/composition-support-in-ria-services.aspx

    Generally, if you don't know if you need composition or not, then you don't need it. To be exact, if you have validation rules at the "parent" level that depend on values in the "children", then that is when you need composition. In most other cases you should avoid it.

    Monday, May 3, 2010 3:23 PM

All replies

  • The association tag is automatically generated for Entity Framework and LINQ to SQL. When using POCOs or other alternate DALs you need to create the tag yourself. Having the include without an association will not do anything.

    Here is information about composition: http://blogs.msdn.com/digital_ruminations/archive/2009/11/18/composition-support-in-ria-services.aspx

    Generally, if you don't know if you need composition or not, then you don't need it. To be exact, if you have validation rules at the "parent" level that depend on values in the "children", then that is when you need composition. In most other cases you should avoid it.

    Monday, May 3, 2010 3:23 PM
  • Thanks.
    Monday, May 3, 2010 4:15 PM