c# 4.0 - Castle Wcf facility self hosting - Repository lifestyles -
i'm self hosting wcf services using castle windsor on windows service. before hosting them on iis , registering repository objects (am following repository pattern ef 5.0 orm) perwebrequest. working while hosting on iis because able add below line in web.config file -
<system.webserver> <modules> <add name="perrequestlifestyle" type="castle.microkernel.lifestyle.perwebrequestlifestylemodule, castle.windsor" /> </modules>
but self hosting. cannot add above module. assume recommended approach use perwebrequest repositories in wcf service otherwise might create issues contexts , transactions. there other lifestyle similar perwebrequest can use while doing self hosting ? or please advise if assumption wrong?
thanks in advance
sai
update
i tested repositories being registered container transient lifetstyle , fails inserts or updates. because everytime requests object container returns new object, loosing dbcontext object. has faced similar problem mine?
have looked @ built in wcf facility lifestyles?
Comments
Post a Comment