I am using the out of the box ValuesController in a ASP.NET Web API application
public class ValuesController : ApiController { // GET api/values
In OData v4, $inlinecount=allpages has been replaced by $count=true.
$count just works with returning an IQueryable in the recent versions of aspnet mvc.