コード例 #1
0
        public void UpdateLayer(SlideLayer layer)
        {
            _readDb.Attach(layer);
            _readDb.Entry(layer).State = EntityState.Modified;

            _readDb.SaveChanges();
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
        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);
        }