Last active
February 2, 2021 16:40
-
-
Save SibeeshVenu/9f8ef9786d7ac321e0524b49d04641ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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