Beispiel #1
0
 public TimedAction(ITimer timer, Action action, float secondsToWait)
 {
     this.timer          = timer;
     this.action         = action;
     this.secondsToWait  = secondsToWait;
     this.timestampStart = timer.GetCurrentTime();
 }
        public async Task InvokeAsync(HttpContext httpContext, ITimer timer, ILogger <Order> logger)
        {
            string currenttime = timer.GetCurrentTime();

            string cfg = timer.GetConfig("id", "age", "color", "name", "city", "person:company:companyname");

            string login = "";

            logger?.LogInformation($"Process info {httpContext.Request.QueryString}");

            if (httpContext.Request.Cookies.TryGetValue("login", out login))
            {
                await httpContext.Response.WriteAsync($"current time is {currenttime} \n config:\n{cfg} \n LOGIN = {login}");
            }
            else
            {
                httpContext.Response.Cookies.Append("login", "login1");
                await httpContext.Response.WriteAsync($"current time is {currenttime} \n config:\n{cfg} \n LOGIN = {login}");
            }

            //await httpContext.Response.WriteAsync($"current time is {currenttime} \n config:\n{cfg}");
        }
Beispiel #3
0
 public bool ItsTime()
 {
     return(timer.GetCurrentTime() >= timestampStart + secondsToWait);
 }