[英]how can filter data of calender in c# according to room names?
如何根據房間名稱過濾我的 Outlook 事件?
var queryOptions1 = new List<QueryOption>()
{
new QueryOption("startDateTime", starttimeluis ),
new QueryOption("endDateTime", Endtimeluis)
};
var calendarView1 = await graphClient.Me.Calendar.CalendarView
.Request(queryOptions1)
.GetAsync();
我想根據房間名稱過濾日歷事件數據,如何在c#.net中進行查詢?
您可以嘗試以下代碼片段
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var findRooms = await graphClient.Me
.FindRooms("Building2Rooms@YourOrganization.onmicrosoft.com")
.Request()
.GetAsync();
由於它是Microsoft Graph beta version
因此您已安裝Microsoft.Graph.Beta package
。 請參閱下面的屏幕截圖
更多詳情請參考官方文檔
更新:
你可以像這樣的格式$filter
你的查詢:
HttpClient client = new HttpClient();
HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages?$filter=ReceivedDateTime ge 2017-04-01 and receivedDateTime lt 2017-05-01");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", "eyJ0eXAiOiJKV1QiLCJub25jZSI6IkFRQUJBQUFB");
HttpResponseMessage response = await client.SendAsync(request);
string output = await response.Content.ReadAsStringAsync();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.