I'm in need of help in getting the host/domain name and port of my application.
So far, here's my sample code in my Configure
method inside the Startup.cs
:
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
var url = ""; // something that will get the current host/domain and port of the running applicaiton.
RecurringJob.AddOrUpdate<ISomething>(i=>i.SomethingToExecute(url), Cron.Daily);
}
Because I need to pass the url
string to my SomethingToExecute
method
public class Something : ISomething
{
public void SomethingToExecute(string url){
...
Debug.WriteLine(url)
}
}