简体   繁体   中英

How do I refresh an existing object using SQLite.NET?

I'm using SQLite.NET and the SQLite.NET extensions to represent objects coming from a Rest API. This is my workflow:

  • Create an object locally
  • Save it to the DB.
  • On a background thread:
    • Get a copy of the object
    • POST it to the server
    • Update the object with what comes back
    • Save this copy of the object back to the DB
  • Get notified that my object has updated.

At this point, what I want is to refresh my copy of my object with the saved data from the DB. I do not want to throw my object away and create a new one. Calling GetChildren refreshes the children, but it isn't refreshing the properties of the object itself.

How do I refresh an existing object using SQLite.NET?

Very much a late answer, but this capability does not exist within SQLite.Net's API. I'm sure you've already done the obvious (pull the record, get the non-relationship properties, and copy them over).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM