public void UpdateLayer(SlideLayer layer) { _readDb.Attach(layer); _readDb.Entry(layer).State = EntityState.Modified; _readDb.SaveChanges(); }
public void UpdateModel(SlideShowWidget model) { using (var db = new SlideShowDbContext(_db)) { db.Attach <SlideShowWidget>(model); db.Entry(model).State = Microsoft.EntityFrameworkCore.EntityState.Modified; db.SaveChanges(); } }
public async Task <Slide> UpdateAsync(Slide document) { // TODO: How to handle non-Drive image URLs? Thumbnails handled how? using (var db = new SlideShowDbContext(_writeDb)) { db.Attach(document); db.Entry(document).State = EntityState.Modified; await db.SaveChangesAsync(); } return(document); }