Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial updating with InMemoryDatabases #4527

Closed
Gekctek opened this issue Feb 10, 2016 · 0 comments
Closed

Partial updating with InMemoryDatabases #4527

Gekctek opened this issue Feb 10, 2016 · 0 comments
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@Gekctek
Copy link

Gekctek commented Feb 10, 2016

Instead of pulling a full database object into code, updating it and then saving it in the database I like to do partial updates on rows with entity framework like this:

var efObject = new EfObject
{
    Id = participantTaskId,
    Date = DateTime.UtcNow
    //Has other properties that are not being set
};
EntityEntry<EfObject> entry = this.dbContext.EfObjects.Attach(efObject);
entry.Property(ps => ps.Date).IsModified = true;
await this.dbContext.SaveChangesAsync();

And it always seems to work fine. But recently when doing automated testing with the in memory databases this will update the efObject to only having an id and a date. All other properties for that object will be default values, even if they had values before.

I am assuming this is a bug and will be fixed. Is there any work around for this besides doing a full update?

@rowanmiller rowanmiller added this to the 1.0.0 milestone Feb 10, 2016
mikary added a commit that referenced this issue Mar 2, 2016
Throw DbUpdateConcurrencyException on invalid updates to InMemory store
@mikary mikary added the 2 - Done label Mar 2, 2016
@mikary mikary closed this as completed in 5cef592 Mar 2, 2016
@mikary mikary modified the milestones: 1.0.0-rc2, 1.0.0 Mar 2, 2016
@ajcvickers ajcvickers removed this from the 1.0.0-rc2 milestone Oct 15, 2022
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
@ajcvickers ajcvickers added this to the 1.0.0 milestone Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

4 participants