Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Unable to get key from IDictionary values in Match function

$
0
0
        public bool Match(HttpContext httpContext, IRouter route, string routeKey, IDictionary<string, object> values, RouteDirection routeDirection)
        {
            string pathName = "";

            RouteValueDictionary dict = (values as RouteValueDictionary);
            object o;
            dict.TryGetValue("path", out o);
            dict.TryGetValue("Path", out o);



            var result = values.Where(k => k.Key.Equals("path", StringComparison.OrdinalIgnoreCase)).SingleOrDefault().Value;

unable to get key while debugger shows the key and its value , how to get the key and value?
I have Match


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>