Hi all,
I'm trying to add an existing user to an existing group. I know the ObjectID of both objects from a previous request made with another client. So what I do is that I query Graph API for group and user objects based on their ObjectID and then I add a link between them of type "members".
The last operation does not work and give me the error "System.InvalidOperationException : The context is not currently tracking the entity."
I have the same result if I try to add the relation "memberOf" (I'm not even sure it is supposed to work, never seen this in an example ...).
Other peope on StackOverflow are reporting the same issue here and here
StackTrace :
at System.Data.Services.Client.EntityTracker.GetEntityDescriptor(Object resource)at System.Data.Services.Client.DataServiceContext.EnsureRelatable(Object source, String sourceProperty, Object target, EntityStates state)
at System.Data.Services.Client.DataServiceContext.AddLink(Object source, String sourceProperty, Object target)
at CIW.IAM.Connectors.OfficeRestBll.AddGroupMember(String groupID, String memberID)
at CIW.IAM.Connectors.Office365Bll.AddGroupMember(String groupID, String memberID, List`1 groupAttributes)
at CIW.IAM.Connectors.Form1.CUDGroupInternal()
at CIW.IAM.Connectors.Form1.<btnCUDGroupRest_Click>b__4e()
at CIW.IAM.Connectors.Form1.bw_DoWork(Object sender, DoWorkEventArgs e)