Hi.
I've got the following query working:
var userLookupTask = client.Users.Where(user => user.UserPrincipalName.Equals(
"abc@here.com", StringComparison.CurrentCultureIgnoreCase)).ExecuteSingleAsync();
"abc@here.com", StringComparison.CurrentCultureIgnoreCase)).ExecuteSingleAsync();
User userToUpdate = (User)await userLookupTask;
But I would like to be able to feed in a string $filter like "userPrincipalName eq abc@here.com". I've seen the example below that uses DataServiceQuery but am clueless how to adapt it for Microsoft.Azure.ActiveDirectory.GraphClient:
// Create the DataServiceContext using the service URI.
NorthwindEntities context = new NorthwindEntities(svcUri);
NorthwindEntities context = new NorthwindEntities(svcUri);
// Define a query for orders with a Freight value greater than 30
// and that is ordered by the ship date, descending.
DataServiceQuery<Order> selectedOrders = context.Orders
.AddQueryOption("$filter", "Freight gt 30")
.AddQueryOption("$orderby", "OrderID desc");
// and that is ordered by the ship date, descending.
DataServiceQuery<Order> selectedOrders = context.Orders
.AddQueryOption("$filter", "Freight gt 30")
.AddQueryOption("$orderby", "OrderID desc");
try
{
// Enumerate over the results of the query.
foreach (Order order in selectedOrders)
{
Console.WriteLine("Order ID: {0} - Ship Date: {1} - Freight: {2}",
order.OrderID, order.ShippedDate, order.Freight);
}
}
catch (DataServiceQueryException ex)
{
throw new ApplicationException(
"An error occurred during query execution.", ex);
}
Any ideas?