Hi,
My code:
myEntity= (from t in xrmContext.MyEntitySet
where t.myEntityId == myEntityId .lookUpField.Id
select new MyEntity()
{
myEntityId = t.myEntityId,
field1=t.field
}).FirstOrDefault();
myEntity.EntityState = EntityState.Changed;
service.Update(myEntity);
In the line myEntity.EntityState = EntityState.Changed;
I get an error: The entity is read-only and the 'EntityState' property cannot be modified. Use the context to update the entity instead.
What should I do?
thanks!
*This post is locked for comments
I have the same question (0)