Using ASP.NET Core 1.1 with VS2015 (sdk 1.0.0-preview2-003131), I have the following controller:
public class QueryParameters
{
    public int A { get; set;          
        
Use attribute routing and list each required parameter in the function's HttpGet attribute.
[Route("api/[controller]")]
public class ValuesController : Controller
{
    [HttpGet("{A}")]
    public IEnumerable Get(int A, int B)
    {
       return new [] { A.ToString(), B.ToString() };
    }
}
 
This will require e.g /5 and allow /5?B=6 query url parameters.