The issue comes from:
http://stackoverflow.com/questions/13561604/odata-result-with-an-empty-listzero-count-results-in-an-error
The scenario is that user uses ODataResult<T> to customize next page link and inline count in action. What happens if the result collection is empty? The expected behavior is to return an empty collection with inlinecount as zero but without next page link.
The actual behavior is throwing: System.ArgumentOutOfRangeException occurred
HResult=-2146233086
Message=Value must be greater than or equal to 1.
Parameter name: value
Actual value was 0.
Source=System.Web.Http.OData
ParamName=value
StackTrace:
at System.Web.Http.OData.ODataResult.set_Count(Nullable`1 value) in C:\dd\DevDiv\Offcycle\WPT\WebStackRuntime\runtime\src\System.Web.Http.OData\OData\ODataResult.cs:line 36
InnerException: