Skip to content

Instantly share code, notes, and snippets.

@SibeeshVenu
Last active February 2, 2021 16:40
Show Gist options
  • Save SibeeshVenu/9f8ef9786d7ac321e0524b49d04641ab to your computer and use it in GitHub Desktop.
Save SibeeshVenu/9f8ef9786d7ac321e0524b49d04641ab to your computer and use it in GitHub Desktop.
using System;
using System.Threading.Tasks;
using Microsoft.Graph;
namespace < YOURNAMESPACE > {
public interface IGrapFacade {
Task < IGraphServiceUsersCollectionPage > GetUsersUsingGraph(Guid tenantId);
}
public class GraphFacade: IGrapFacade {
private readonly IGraphAuthService _graphAuthService;
public GraphFacade(IGraphAuthService graphAuthService) {
_graphAuthService = graphAuthService;
}
public async Task < IGraphServiceUsersCollectionPage > GetUsersUsingGraph(Guid tenantId) {
var graphClient = _graphAuthService.GetGraphServiceClient(tenantId);
var users = await graphClient.Users.Request().GetAsync();
return users;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment