public void Handle(SampleDomainWithEventSourcingUnpublished e) { using (var db = new SampleDbContext()) { var s = new SampleEntity() { Id = e.Id, Published = false }; var entry = db.Entry <SampleEntity>(s); db.Attach(entry); entry.Property(p => p.Published).IsModified = true; db.SaveChanges(); } }
void Apply(SampleDomainWithEventSourcingUnpublished e) { _published = false; }