I have recently installed the Azure Active Directory Graph Client Library 2.0.2 Nuget package and am unable to add Members to Groups both adding a group to a group or adding a user to a group I am getting the following error when the AddLink function is called:
“[System.InvalidOperationException] = {"The context is not currently tracking the entity."}
My code:
IGroup group = azureClient.Groups.GetByObjectId("Guid here").ExecuteAsync().Result;
IGroup groupToAdd = azureClient.Groups.GetByObjectId("Guid here").ExecuteAsync().Result;
azureClient.Context.AddLink(group, "Members", groupToAdd);
azureClient.Context.SaveChanges();
I have been unable to find any mention of this error in relation to the Azure Active Directory Graph Client Library from doing Google searches so any help on this would be much appreciated.