我需要帮助获取我的应用程序的主机/域名和端口。
到目前为止,在我的Startup.cs
文件中的Configure
方法中,以下是我的样例代码:
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);
}
因为我需要将
url
字符串传递给我的SomethingToExecute
方法。public class Something : ISomething
{
public void SomethingToExecute(string url){
...
Debug.WriteLine(url)
}
}