silverlight - Why Don't DomainService Constructor Overloads Show Up as DomainContext Constructor Overloads? -


i wrote overload domainservice class. problem is, when recompile, it's not showing overload domaincontext. what's wrong? here code sample:

[enableclientaccess] public class fooddomainservice : linqtoentitiesdomainservice<foodentities> {     public fooddomainservice(cultureinfo cultureinfo)     {         thread.currentthread.currentculture = cultureinfo;     } } 

and doesn't work:

fooddomaincontext _foodcontext = new fooddomaincontext(thread.currentthread.currentculture); 

i error there no overload matching that. not allowed this? need attribute of kind?

you not allowed this. when newing context silverlight client, not directly intantiating service. instead, instantiate proxy class generated ria services, , proxy class call service. why don't see constructor: because ria did not generate in proxy.

doing you're trying implicate there round-trip server @ time of newing fooddomaincontext class, not going happen, because need complete initialisation of object before can so.

anyway, instead of can create method called setcurrentculture() , call after initializing proxy.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -