WCF RIA Entities with Composition attribute Insert causes Error Message RRS feed

  • Question

  • I have a WCF DomainService class that I made following the steps for VS 2012 with the exceptions of adding the reference to the lightswtich generated files described here: http://lightswitchhelpwebsite.com/Blog/tabid/61/tagid/21/WCF-RIA-Service.aspx, I'm not storing data in the Lightswitch app I've got  POCO classes and I'm taking care of the data access, so I did not add the references to the lightswitch ApplicationDataContext. My HTML Client loads and I can key data to create a new Order header, and I can add order details. When I try and save my Order Header screen I get the error message "The current user does not have permission to insert entities into the EntitySet 'OrderDetails'.

    There is NO Security on this app, I haven't added it yet and there is none set in the WCF DomainService.

    In the Order Header I have:

            [Association("OrderHeader_OrderDetails", "Id", "OrderHdrID")]
            public DataServiceCollection<OrderDetails> OrderDTL { get; set; }

    The reason for this is I always want to Update the OrderHeader records when ever any of the detail records are updated, from what I've read the Composition Attribute was created for this.

    In my WCF DomainService I have not written an Insert Method for the OrderDetails Entity.

    Would this cause the error Message? Does there have to be a 'dummy' method for [Insert] that takes and OrderDetails Method?

    Thanks in advance;


    Monday, December 16, 2013 10:43 PM