You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var groups = await graphClient.Users[user.UserPrincipalName].MemberOf.GetAsync(); bool isValidUser = groups.Value.Cast<Microsoft.Graph.Models.Group>().Any...
Version 5.22.0 returns the types of the elements correctly, Microsoft.Graph.Models.Group.
Latest version 5.23.0 returns the types as Microsoft.Graph.Models.DirectoryObject and fails to make the cast.
Exception:
System.InvalidCastException: 'Unable to cast object of type 'Microsoft.Graph.Models.DirectoryObject' to type 'Microsoft.Graph.Models.Group'.'
Stack Trace:
at System.Linq.Enumerable.d__971.MoveNext() at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func`2 predicate) at CaptivaApi.Helper.Utilities.IsAuthorized(String groupList) in W:\Source Code\Azure GitHub\ds-capture-dashboard-webapi\CaptivaApi\Helper\Utilities.cs:line 493
See attached screenshots.
Latest version of Visual Studio 2022 (17.7.1)
.NET Framework 4.8
Windows 11
The text was updated successfully, but these errors were encountered:
As @MartinM85 mentioned, this is caused by the change in DirectoryObject.CreateFromDiscriminatorValue. This should be resolved in the next in the course of the week.
Hi,
Have the following code:
var groups = await graphClient.Users[user.UserPrincipalName].MemberOf.GetAsync();
bool isValidUser = groups.Value.Cast<Microsoft.Graph.Models.Group>().Any...
Version 5.22.0 returns the types of the elements correctly, Microsoft.Graph.Models.Group.
Latest version 5.23.0 returns the types as Microsoft.Graph.Models.DirectoryObject and fails to make the cast.
Exception:
System.InvalidCastException: 'Unable to cast object of type 'Microsoft.Graph.Models.DirectoryObject' to type 'Microsoft.Graph.Models.Group'.'
Stack Trace:
at System.Linq.Enumerable.d__97
1.MoveNext() at System.Linq.Enumerable.Any[TSource](IEnumerable
1 source, Func`2 predicate) at CaptivaApi.Helper.Utilities.IsAuthorized(String groupList) in W:\Source Code\Azure GitHub\ds-capture-dashboard-webapi\CaptivaApi\Helper\Utilities.cs:line 493See attached screenshots.
Latest version of Visual Studio 2022 (17.7.1)
.NET Framework 4.8
Windows 11
The text was updated successfully, but these errors were encountered: