question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

update() method Bug

See original GitHub issue

firstly, if I get a enetity used AsNoTracking() . just like that: return await this.Context.BailunOrders.AsNoTracking().Where(a => a.OriginOrderNo == originNo.Trim()).FirstOrDefaultAsync(); and if I use Update(entity) to update the entity defined in IRepository but it doesnt work ~ that didn’t change value in database . finally I have to define a new Update method to resovle the issue

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
acjhcommented, May 18, 2018

Design a value object as immutable (like the Address above) if there is not a good reason for designing it as mutable.

The alternative: “detach the previous owned entity entry first

var context = (_bailunOrderRepository as IRepositoryWithDbContext).GetDbContext();
context.Entry(order.Buyer).State = EntityState.Detached;
context.Entry(order.PayMentInfo).State = EntityState.Detached;
0reactions
andyliyuzecommented, May 18, 2018

thanks~

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update function bug? - Forums
It only runs once. Not once per frame, just literally once, like the Start() function. Yet it works in my other script files....
Read more >
dict.update returns incorrrect value - python bug?
It means that a subclasser has to override every method whose behavior they want to change including get() , update() , and others....
Read more >
How to Fix Windows 10 Update Stuck - 10 Useful Methods
How To Fix Windows 10 Update Stuck – 10 Useful Methods · Method 1: Restart System · Method 2: Search About Error Code...
Read more >
Update & Installation Issues
When installing or updating a game, Steam displays an error message: An error occurred while updating. [game title]. An error occurred while installing....
Read more >
“We couldn't update system reserved partition” error ...
When upgrading to Windows 10, you may encounter the error “We couldn't update system reserved partition”, error code 0xc1900104, or error code 0x8000f0922....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found