Ria Services Passing Complex Object as parameter to a query domain service method

前端 未结 2 656
余生分开走
余生分开走 2021-02-19 20:55

I\'m experiencing some difficulties with a WCF RIA Services similar to the problem specified in this thread.

The domainservice method I\'m creating (a Query method) shou

2条回答
  •  梦谈多话
    2021-02-19 22:01

    Dirty workaround three, is to use the [Invoke] attribute and add a method to the domain service to expose the "complex type", which informs the WCF RIA tooling to create the entity on the client-side:

    public ComplexObjectParameter ExposeComplexObjectParameter()
    {
        throw new NotSupportedException();
    }
    

    I put NotSupportedException in my domain service methods to prevent silent failures if the method is ever called remotely.

    I'm not sure about how this solution affects the issue of losing "all RIA tracking functionality". It does not answer how to create a composable query using a complex type as a parameter.

    It's dirty, but abstracts the problem closest to the source of problem. The calling and receiving code is cleaner. This maintains the "elegance" at the higher level while pushing the dirty down.

提交回复
热议问题