79347169

Date: 2025-01-10 22:26:38
Score: 1
Natty:
Report link

As suggested by @ADyson i used Filter.

Here the solution: stackoverflow.com/a/24026535/3061212

this my code:

    public class CustomAuthFilter : AuthorizationFilterAttribute
        {
            public override void OnAuthorization(HttpActionContext actionContext)
            {
                KeyValuePair<string, string>[] values = (KeyValuePair<string, string>[])actionContext.Request.Properties["MS_QueryNameValuePairs"];    
                string MyVar = Guid.Parse(values.Where(f => f.Key.Equals("MyVar")).FirstOrDefault().Value);    
            }
        }

    [CustomAuthFilter]
    public class FastSchedulerController : ApiController
    {           

        [Route("api/FastScheduler/test")]
        [HttpGet]
        public string test(string id)
        {
            return id;
        }
  }
Reasons:
  • Blacklisted phrase (1): stackoverflow
  • Whitelisted phrase (-2): solution:
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @ADyson
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: elle0087