This is a migrated thread and some comments may be shown as answers.

Context.Add not adding

1 Answer 55 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rui
Top achievements
Rank 1
Rui asked on 04 Jul 2012, 04:57 PM
Hello, I've a call to context.Add(entityX), everything seems to be nice, but is not. 
When I do a Context.GetChanges().GetInserts it returns 0.
No error is raised. And goes good throw the events :
  •  void Events_Added(object sender, AddEventArgs e)
  • void Events_Adding(object sender, AddEventArgs e)

How can his be debugged?



1 Answer, 1 is accepted

Sort by
0
Rui
Top achievements
Rank 1
answered on 04 Jul 2012, 05:13 PM
Found the problem... never mind. 
For those who encounter a similar problem see if context.GetHashCode is always the same.

In my case, by mistake in a base class, I was instantiating a new Context on every context call.
In my case the context is a property in a base class that lives in all the class life time.

Anyway, I keep the post just in case someone else need it.
 Thank you

Tags
General Discussions
Asked by
Rui
Top achievements
Rank 1
Answers by
Rui
Top achievements
Rank 1
Share this question
or