Route {bool*} can not recogn num

[Route("/uselog/{Project}/{User}/{Value}/{Save*}")]
    public class UseLogCheck
    {
        public string Project { get; set; }
        public string User { get; set; }
        public string Value { get; set; }
        public DateTime TestTime { get; set; } = DateTime.Now;
        
        public bool Save { get; set; }
        public DateTime EndTime { get; set; } = DateTime.Today.AddDays(1);
    }

http://xx.com/uselog/p/u/v.json?save=1 save= true
but http://xx.com/uselog/p/u/v/1.json get error Unable to bind to request 'UseLogCheck'


my mistake on *

  [Route("/uselog/{Project}/{User}/{Value}")]
    [Route("/uselog/{Project}/{User}/{Value}/{Save}")]
    public class UseLogCheck

above is ok ,it seem only ‘1’ will converto true

Right only use the wildcards Routes (i.e. {Save*}) on strings.

But you really shouldn’t have bools in your queryString, i.e. they’re not going to be useful for defining the resource identifier. In this case it’s just an attribute of the request so I’d remove it from the Route’s /path/info so it’s just on the QueryString, e.g:

[Route("/uselog/{Project}/{User}/{Value}")]
public class UseLogCheck
{
    public string Project { get; set; }
    public string User { get; set; }
    public string Value { get; set; }
    public DateTime TestTime { get; set; } = DateTime.Now;
    
    public bool Save { get; set; }
    public DateTime EndTime { get; set; } = DateTime.Today.AddDays(1);
}

Which you can be added on the queryString when needed:

/uselog/p/u/v
/uselog/p/u/v.json?save=1

If you want to use numbers use an integer Type. There is built-in bool coercion but the only values should be 0 or 1.

Thank you for your explanation