示例#1
0
        public IActionResult Index()
        {
            var teste = HashIdsUtil.Encode(1);

            var te = HashIdsUtil.Decode(teste);

            return(View(AllContacts));
        }
示例#2
0
        public override void OnActionExecuting(ActionExecutingContext context)
        {
            foreach (var routeDataValue in context.RouteData.Values)
            {
                if (routeDataValue.Key.EndsWith("id", StringComparison.OrdinalIgnoreCase))
                {
                    context.ActionArguments[routeDataValue.Key] = HashIdsUtil.Decode(routeDataValue.Value);
                }
            }

            base.OnActionExecuting(context);
        }