Hi, i am trying to move my business logic out from the controllers and into their own services. I have setup my controller like so:
public class AccountController : Controller
{
private readonly IAccountService _accountService;
public AccountController(IAccountService accountService)
{
_accountService = accountService;
}
....
}
The dependencies are injected fine via Microsoft Unity. However i'd like to use the Url.GenerateUrl helper methods within my implementation of IAccountService but Url is a property against the controller. I looked at the MVC source to see how this is done but i requires me to access the request context from outside of the controller but i'm not sure how this is done.
I'd appreciate it if someone could help. Thanks