Composition in POCO class and WCF Ria Services RRS feed

  • Question

  • Hello,


    First I would like to apologize for my poor English, will probably have some errors.


    I would ask for help with a problem I'm facing.


    First I will tell my environment, I need to do a midrange system using technology Microsoft Silverlight, so I opted to use the Silverlight technology WCF Ria  Services and to persist data using the Entity Framework 4.0 feature POCO entities.


    Now I need to create an entity with the following structure:




    Got this in an environment ClassDiagram and EF4 also have a similar environment (see the project file)


    The problem I'm facing is, see that for the perfect operation of the application I have to have the method in InsertAddress DomainService (DomainService1.cs file) if I make the filling and the persistency method InsertAddress an error occurs, if I put the attribute Composition Property Address in the Person class I got an error in the compilation "Composed type 'SilverEF4.Web.Address' can only Have an Insert method if all types of ITS parent support Also Update or Insert." If the method comment InsertAddress compiles and runs ok the application normally, but when I run the commands


                DomainService1 ds = new DomainService1();




    This EntitySet have an error of type 'SilverEF4.Web.Address' does not support the 'Add' operation.


    So I get no choice, being forced to have the method InsertAddress blank and I still need to get the attribute Address Composition of the property for the operation. I believe this is an error WCF Ria Services, if not an error please like to know how to solve this scenario.


    Download the Code http://djonatas.net/error/SilverEF4.rar

    Wednesday, August 11, 2010 5:44 AM