Cannot save entity because it is not tracked by the context.
Posted: Tue 08 Aug 2017 21:28
Devart“s newbie here...
I made a partial class to complement the DataContext as generated by Entity developer (5.7.586) so I
can implement the partials Insert/Update/Delete, this way
The last is to change the signature, so it can be public. But when I call this method with a new instance of SomeEntity, the library throws an exception saying "Cannot save the entity object 'SomeEntity' because it is not tracked by the context."
If the partial methods are there (in the code generated) as well as a collection of them ( public Devart.Data.Linq.Table<SomeEntity> SomeEntities) how is this that the entity is not tracked?
What am I doing the wrong way?
TIA
I made a partial class to complement the DataContext as generated by Entity developer (5.7.586) so I
can implement the partials Insert/Update/Delete, this way
Code: Select all
partial void InsertSomeEntity(SomeEntity instance)
{
ExecuteDynamicInsert(instance);
}
public void InsertSomeEntity(SomeEntity instance, bool dummy )
{
InsertSomeEntity(instance);
}
If the partial methods are there (in the code generated) as well as a collection of them ( public Devart.Data.Linq.Table<SomeEntity> SomeEntities) how is this that the entity is not tracked?
What am I doing the wrong way?
TIA