Quantcast
Channel: Azure Active Directory forum
Viewing all articles
Browse latest Browse all 16000

Graph API C#: unable to add a member to a group with error 'Context is not currently tracking the entity'

$
0
0

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)


Viewing all articles
Browse latest Browse all 16000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>