Need communication between the DomainContext and the stateless DomainService
i'm migrating prototype made wpf , entity framework 4 silverlight 4 , wcf ria services v1.0.
in wpf application added property (let's call referenceenterprise) "objectcontext" implement business logic that, using "objectmaterialized" event, lets me calculate on each , every entity related entities , values (not mapped underlaying database, anyway extracted database, although relative property explained), added every entity using partial class definition.
for example, user logs in application , selects enterprise, create objectcontext (modelcontainer) , set referenceenterprise property according selected value. after moment, each , every query gets data related enterprise in special properties added each entity (some iqueryable<someentity>). anytime during application lifetime, user can select different enterprise, , objectcontext gets replaced new 1 using different referenceenterprise.
this model worked me when had real control on objectcontext creation, using wpf, without middle tier exposing services.
now i'm trying make prototype work in silverlight using ria services, don't know how set referenceenterprise on "objectcontext".
although there's overridable "createobjectcontext" method on domainservice, don't know how send referenceenterprise "domaincontext" on silverlight client "domainservice" on middle tier (web application), can use in "createobjectcontext" method.
i don't know if there's easy way achieve task, think there's lot of people asking kind of communication between domainservice , domaincontext.
the ideal solution me set property once on domaincontext each , every time domainservice gets created domaincontext call, property gets assigned on domainservice too. i've found related posts asking passing arguments domainservice constructor benefit solution.
using kind of customizable "context" (like webcontext, authorizationcontext, etc...) gets passed domainservice perfect.
obviously, implementing custom invoke method on domainservice set property in objectcontext doesn't @ because domainservice "stateless".
______________________________________________________________________________________________________
comments "you trying use apple make orange juice" not welcome, please polite...
also, post is on topic, but utility code shows how to get @ wcf guts of domaincontext. use similar solution add custom information wcf message.
http://blogs.msdn.com/b/kylemc/archive/2010/05/14/ria-services-authentication-out-of-browser.aspx
kyle
Silverlight > WCF RIA Services with Silverlight
Comments
Post a Comment