ServiceStack Ormlite UpdateNonDefaults for a NULL Field

1 answer

bool properties are now always included in UpdateNonDefaults() with this UpdateNonDefaults() , which allows you to do the following:

 public class Poco { public int Id { get; set; } public bool Bool { get; set; } } var db = OpenDbConnection(); db.DropAndCreateTable<Poco>(); db.Insert(new Poco { Id = 1, Bool = true }); db.UpdateNonDefaults(new Poco { Bool = false }, x => x.Id == 1); var row = db.SingleById<Poco>(1); row.Bool // false 

This change is available from v4.0.39 + , which is now available on MyGet .

0
source

All Articles