MCPcopy Create free account
hub / github.com/FrodeHus/EntraRoleReaper / GetUserById

Method GetUserById

server/Review/UserService.cs:29–48  ·  view source on GitHub ↗
(string userId, Guid tenantId)

Source from the content-addressed store, hash-verified

27 }
28
29 public async Task<UserContext> GetUserById(string userId, Guid tenantId)
30 {
31 var cachedUserContext = cacheService.GetUserContext(userId, tenantId);
32 if (cachedUserContext != null)
33 {
34 return cachedUserContext;
35 }
36 var userData = await graphService.GetUserAndRolesAsync(userId);
37 var userContext = new UserContext
38 {
39 UserId = userId,
40 TenantId = tenantId,
41 DisplayName = userData.DisplayName,
42 ActiveRoleIds = userData.ActiveRoleIds,
43 EligibleRoleIds = userData.EligibleRoleIds,
44 PimActiveRoleIds = userData.PimActiveRoleIds
45 };
46 cacheService.SetUserContext(userContext);
47 return userContext;
48 }
49}

Callers 1

EvaluateMethod · 0.45

Calls 3

GetUserContextMethod · 0.45
GetUserAndRolesAsyncMethod · 0.45
SetUserContextMethod · 0.45

Tested by

no test coverage detected