Search code examples
c#uwpmicrosoft-graph-apimicrosoft-graph-onenote

A request with the GraphServiceclient for notebooks, the query option "select" needs "name" instead "displayname"


With the query option "select" the properties in the requested notenooks can be reduced. If i try this in the Graph explorer, the select statement looks like "$select=id,displayname,createddatetime" The same procedure with the GraphSeviceClient (UWP, c#) looks like:

RequestOptions.Add(new QueryOption("select", "id"));
        RequestOptions.Add(new QueryOption("select", "name"));
        RequestOptions.Add(new QueryOption("select", "links"));
        RequestOptions.Add(new QueryOption("select", "createdTime"));

My question is, why are the values in the query options not the same? name instead displayname createdTime instead createddatetime

Best regards an thanks for answering


Solution

  • A request with the GraphServiceclient for notebooks, the query option “select” needs “name” instead “displayname”

    Great question, I checked the related document, I think it's by design. The createdTime name query word are just parameter, and it will matched with displayName and createdDateTime in method internal. For doing this could prevent confusion. For using QueryOption we could check this document to get the correct query word.