开发者

Get current web host and app directory from class library

开发者 https://www.devze.com 2023-02-09 12:00 出处:网络
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百科

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消