This question is locked. New answers and comments are not allowed.
Hi,
I have been having hard time making telerik data access work. So I decided to post my issue here:
My example:
I am using fluent mapping and I have few classes. I have Entity A, B and parent of B is A. B has a constructor that takes A in it. Also B references A. In the construcor of B I assign a value to a reference property. Something like this:
public B(A anchor)
{
this.A = anchor;
}
After creating a new instance of B if I try Telerik.OpenAccess.OpenAccessContextBase.GetContext(b) it returns null. So then I am doing this. telericContext.Add(b) it is throwing exception: Object references between two different object scopes are not allowed. The object '' is already managed by 'ObjectScopeImpl 0x2 OpenAccessRuntime.EnlistableObjectScope' and was tried to be managed again by 'ObjectScopeImpl 0x1 OpenAccessRuntime.EnlistableObjectScope'.
If I don't add b to telerikContext after creating a new instance of B it tells it is not tracked. I am very confused. When I try getting the context of b after it is created it says it is null, but when I try to add it to telerikContext it says it already in the scope. What should I do?
Help appreciated!
I have been having hard time making telerik data access work. So I decided to post my issue here:
My example:
I am using fluent mapping and I have few classes. I have Entity A, B and parent of B is A. B has a constructor that takes A in it. Also B references A. In the construcor of B I assign a value to a reference property. Something like this:
public B(A anchor)
{
this.A = anchor;
}
After creating a new instance of B if I try Telerik.OpenAccess.OpenAccessContextBase.GetContext(b) it returns null. So then I am doing this. telericContext.Add(b) it is throwing exception: Object references between two different object scopes are not allowed. The object '' is already managed by 'ObjectScopeImpl 0x2 OpenAccessRuntime.EnlistableObjectScope' and was tried to be managed again by 'ObjectScopeImpl 0x1 OpenAccessRuntime.EnlistableObjectScope'.
If I don't add b to telerikContext after creating a new instance of B it tells it is not tracked. I am very confused. When I try getting the context of b after it is created it says it is null, but when I try to add it to telerikContext it says it already in the scope. What should I do?
Help appreciated!