MVC Routes - How to get a URL?

Posted by Seattle Leonard on Stack Overflow See other posts from Stack Overflow or by Seattle Leonard
Published on 2010-05-21T17:01:23Z Indexed on 2010/05/21 19:20 UTC
Read the original article Hit count: 201

Filed under:
|
|

In my current project we have a notification system. When an oject is added to another objects collection, an email is sent to those who are subscibed to the parent object. This happens on the object layer and not in the View or Controller.

Here's the problem:

Although we can say who created what with what information in the email, we cannot embed links to those objects in the email because in the object layer there is no access to a UrlHelper. To construct a UrlHelper you need a RequestContext, which again does not exist on the object layer.

Question:

I want to make a helper class to create the url's for me. How can I create an object that will generate these urls without a request context? Is it possible?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about url