The newly added DriveItem object returns the listItem field as null, which means that the relationship between DriveItem and ListItem offered by Graph Api cannot be used.
I created new DriveItem:
var driveItemResult= await CreateGraphClient().Groups[_options.GroupId].Sites[_options.SiteId]
.Drives[_driveOptions.DriveId]
.Root
.Children
.Request()
.AddAsync(driveItem).ConfigureAwait(false);
Now I would like to update custom columns in it. I know this is possible if you get driveItem as listItem. So I would like to do this:
var listItem= await CreateGraphClient().Groups[_options.GroupId].Sites[_options.SiteId]
.Lists[_listOptions.ListTitle]
.Items[driveItemResultId]
.Request()
.AddAsync(driveItem).ConfigureAwait(false);
But driveItemResult.Id
returns Guid. I need Id as number to take Item from list. And driveItem has property listItem. So I thought I can get correct id if I take driveItem.ListItem.Id
but driveItem.ListItem
is always null.
Do you know what could caused this behavior or how to get correct id?