I want to send an email confirmation from my service layer (class library). This can be triggered from an asp.net mvc controller or a wcf service.
开发者_Python百科How do I build the Url from the service layer?
The service layer shouldn't have knowledge of how urls are constructed in your web application, especially because those rules can easily change. Also this makes your service layer tightly coupled to the web layer and less reusable. What if tomorrow you wanted to reuse this service layer in a desktop application?
IMHO that's an information that should be passed from the controller to the service layer.
精彩评论