Microsoft graph SingleValueLegacyExtendedProperty 请求 returns 空 GUID
Microsoft graph SingleValueLegacyExtendedProperty request returns empty GUID
我请求使用 Graph-SDK 从日历中的所有事件中获取特定的单个值 属性。为了实现这一点,我根据 Graph APIs 文档 (https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/singlevaluelegacyextendedproperty_get) 使用了一个过滤器。我使用的过滤器是“id eq 'Boolean {00062002-0000-0000-C000-000000000046} Id 0x8223'”。以下是我用于此请求的代码。
public static async Task<Tuple<List<Event>, List<ICalendarEventsCollectionRequest>>> GetEventsSingleValuePropertyAsync(GraphServiceClient graphClient, String userId, String calendarId, String filterQuery, int top, String select)
{
List<ICalendarEventsCollectionRequest> requestList = new List<ICalendarEventsCollectionRequest>();
// filterQuery = "id eq 'Boolean {00062002-0000-0000-C000-000000000046} Id 0x8223'"
String filterSingleVP = "singleValueExtendedProperties($filter=" + filterQuery + ")";
List<Event> eventList = new List<Event>();
ICalendarEventsCollectionPage result = null;
ICalendarEventsCollectionRequest request = null;
if (calendarId == "")
request = graphClient.Users[userId].Calendar.Events.Request().Expand(filterSingleVP).Top(top).Select(select);
else
request = graphClient.Users[userId].Calendars[calendarId].Events.Request().Expand(filterSingleVP).Top(top).Select(select);
try
{
if (request != null)
{
result = await request.GetAsync();
requestList.Add(request);
eventList.AddRange(result);
}
if (result != null)
{
var nextPage = result;
while (nextPage.NextPageRequest != null)
{
var nextPageRequest = nextPage.NextPageRequest;
nextPage = await nextPageRequest.GetAsync();
if (nextPage != null)
{
requestList.Add(nextPageRequest);
eventList.AddRange(nextPage);
}
}
}
}
catch
{
throw;
}
return new Tuple<List<Event>, List<ICalendarEventsCollectionRequest>>(eventList, requestList);
}
我获取了所有事件,并且每个与查询匹配的事件都使用 SingleValueLegacyExtendedProperty 进行了扩展。唯一困扰我的是它看起来像这样:
"singleValueExtendedProperties":
[
{
"value":"true",
"id":"Boolean {00000000-0000-0000-0000-000000000000} Id 0x8223"
}
],
如您所见,值存在,但 ID 现在的 GUID 为空。
我测试了一些其他属性,但我总是得到相同的结果。
我认为我的过滤器将给定的 "filterQuery" 与答案中的 "id" 进行比较。
是我误解了什么还是我的请求执行有误?
这看起来像是我们这边的一个错误。似乎 Guid 道具可能没有正确设置或序列化。我会把它提交给团队 - 感谢您的报告。
-编辑-
是的,事实上我们已经有一个解决方案,应该在几天内检查。
-编辑,编辑-
仅出于教育目的,它以这种方式运行的原因是您使用的 GUID 是 "well known guids" 之一。在这种情况下,我们的代码在内部设置众所周知的 GUID 字段而不是普通的 propertySetId guid 字段,并且 REST 在呈现响应时始终使用 propertySetId。如果 propertySetId 是 Guid.Empty.
,我们这边的解决方法当然是使用众所周知的 guid 字段
-编辑,编辑,编辑-
为此检查了一个修复程序并将开始正常推出。它应该会在几周内达到 WW 饱和度。
我请求使用 Graph-SDK 从日历中的所有事件中获取特定的单个值 属性。为了实现这一点,我根据 Graph APIs 文档 (https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/singlevaluelegacyextendedproperty_get) 使用了一个过滤器。我使用的过滤器是“id eq 'Boolean {00062002-0000-0000-C000-000000000046} Id 0x8223'”。以下是我用于此请求的代码。
public static async Task<Tuple<List<Event>, List<ICalendarEventsCollectionRequest>>> GetEventsSingleValuePropertyAsync(GraphServiceClient graphClient, String userId, String calendarId, String filterQuery, int top, String select)
{
List<ICalendarEventsCollectionRequest> requestList = new List<ICalendarEventsCollectionRequest>();
// filterQuery = "id eq 'Boolean {00062002-0000-0000-C000-000000000046} Id 0x8223'"
String filterSingleVP = "singleValueExtendedProperties($filter=" + filterQuery + ")";
List<Event> eventList = new List<Event>();
ICalendarEventsCollectionPage result = null;
ICalendarEventsCollectionRequest request = null;
if (calendarId == "")
request = graphClient.Users[userId].Calendar.Events.Request().Expand(filterSingleVP).Top(top).Select(select);
else
request = graphClient.Users[userId].Calendars[calendarId].Events.Request().Expand(filterSingleVP).Top(top).Select(select);
try
{
if (request != null)
{
result = await request.GetAsync();
requestList.Add(request);
eventList.AddRange(result);
}
if (result != null)
{
var nextPage = result;
while (nextPage.NextPageRequest != null)
{
var nextPageRequest = nextPage.NextPageRequest;
nextPage = await nextPageRequest.GetAsync();
if (nextPage != null)
{
requestList.Add(nextPageRequest);
eventList.AddRange(nextPage);
}
}
}
}
catch
{
throw;
}
return new Tuple<List<Event>, List<ICalendarEventsCollectionRequest>>(eventList, requestList);
}
我获取了所有事件,并且每个与查询匹配的事件都使用 SingleValueLegacyExtendedProperty 进行了扩展。唯一困扰我的是它看起来像这样:
"singleValueExtendedProperties":
[
{
"value":"true",
"id":"Boolean {00000000-0000-0000-0000-000000000000} Id 0x8223"
}
],
如您所见,值存在,但 ID 现在的 GUID 为空。 我测试了一些其他属性,但我总是得到相同的结果。 我认为我的过滤器将给定的 "filterQuery" 与答案中的 "id" 进行比较。
是我误解了什么还是我的请求执行有误?
这看起来像是我们这边的一个错误。似乎 Guid 道具可能没有正确设置或序列化。我会把它提交给团队 - 感谢您的报告。
-编辑- 是的,事实上我们已经有一个解决方案,应该在几天内检查。
-编辑,编辑- 仅出于教育目的,它以这种方式运行的原因是您使用的 GUID 是 "well known guids" 之一。在这种情况下,我们的代码在内部设置众所周知的 GUID 字段而不是普通的 propertySetId guid 字段,并且 REST 在呈现响应时始终使用 propertySetId。如果 propertySetId 是 Guid.Empty.
,我们这边的解决方法当然是使用众所周知的 guid 字段-编辑,编辑,编辑- 为此检查了一个修复程序并将开始正常推出。它应该会在几周内达到 WW 饱和度。