public virtual IActionResult Contact([FromServices] IContactService service, [FromServices] IConnectionMultiplexerProvider connectionMultiplexerProvider)
        {
            Random random = new Random();
            var    num    = random.Next(10);

            connectionMultiplexerProvider.ConnectionMultiplexer.GetDatabase().StringSet("message", $"我是随机数 {num}");

            var b = ReferenceEquals(service, _contactService) && ReferenceEquals(service, ContactService);

            ViewData["Message"] = service.GetMessage() + " " + b;

            return(View());
        }
        public IActionResult About([FromServices] IConnectionMultiplexerProvider connectionMultiplexerProvider)
        {
            var result = connectionMultiplexerProvider.ConnectionMultiplexer.GetDatabase().StringGet("message");

            var f**k = _contactService.GetMessage();

            //Debug.WriteLine(f**k);

            ViewData["Message"] = result.HasValue ? f**k + " " + result : "empty";

            //Random random = new Random();

            //for (int i = 0; i < 10; i++)
            //{
            //    Task.Run(() =>
            //    {
            //        Task.Delay(TimeSpan.FromMilliseconds(random.Next(5))).Wait();
            //    });
            //}

            return(View());
        }
Beispiel #3
0
 public TokenCache(IConnectionMultiplexerProvider connectionMultiplexerProvider)
 {
     _connectionMultiplexerProvider = connectionMultiplexerProvider;
 }
        public IActionResult About([FromServices] IConnectionMultiplexerProvider connectionMultiplexerProvider)
        {
            ViewData["Message"] = connectionMultiplexerProvider.ConnectionMultiplexer.GetDatabase().StringGet("message");

            return(View());
        }