GNOME Bugzilla – Bug 613981
[Hyena] Allow force insert in SqliteModelProvider.Save ().
Last modified: 2010-03-26 07:41:09 UTC
Adds a Save () overload to SqliteModelProvider which takes a second boolean parameter to cause a forced insert. This is needed for cases where you want to preinitialize the primary key to a certain value. Simply calling Save () would cause the model provider to think that this is an existing object, causing an update to happen. Result: object not saved. Example use case: private class CacheParameters { [DatabaseColumn(Constraints = DatabaseColumnConstraints.PrimaryKey)] public int CacheId { get; set; } [DatabaseColumn] public string Parameters { get; set; } } In this class, the CacheId parameter is set to match the id of objects in another table. Without the overload, there is no way to save it.
Created attachment 157131 [details] [review] Allow force insert in SqliteModelProvider.Save ().
Review of attachment 157131 [details] [review]: Looks good to me
Comment on attachment 157131 [details] [review] Allow force insert in SqliteModelProvider.Save (). Committed, thanks Gabriel!