zzzprojects / GraphDiff

GraphDiff is a library that allows the automatic update of a detached graph using Entity Framework code first.
https://entityframework-graphdiff.net/overview
MIT License
333 stars 101 forks source link

Null ptr exception #51

Closed Robelind closed 10 years ago

Robelind commented 10 years ago

HI.

I'm getting a null ptr exeception with this stack trace:

System.NullReferenceException: Object reference not set to an instance of an object. at RefactorThis.GraphDiff.DbContextExtensions.EnsureConcurrency(DbContext db, T from, T to) at RefactorThis.GraphDiff.DbContextExtensions.UpdateGraph(DbContext context, T entity, Expression`1 mapping)

Trying to investigate the problem I look at the class DbContextExtensions in the source code, but cannot find EnsureConcurrency(). Looking at the de-compiled source code, the implementation of DbContextExtensions is vastly different from the one in the source.

What could be the problem here and how to investigate?

ghost commented 10 years ago

Hi,

the NuGet package is currently quite out-of-date, please try to compile the sources yourself and check if the exception still occurs. It probably won't, but please update this issue if it does.

refactorthis commented 10 years ago

I'm going to update nuget package tonight - @Robelind did building from source fix your issue?

Robelind commented 10 years ago

Haven't gotten around to try it yet. Will try the nuget package as soon as possible.

Robelind commented 10 years ago

I have now tried with Graphdiff built from source and it turns out the problem was my handling of a concurrency column in my disconnected scenario. Once I fixed that to what Graphdiff expected it worked fine. It also works for me with 1.3.6 from Nuget.