示例#1
0
        public async Task <Meal> UpdateAsync(Meal item)
        {
            using var db = new EfMealsDataModel(_options);
            var entityEntry = db.Meals.Update(item);
            await db.SaveChangesAsync().ConfigureAwait(true);

            return(entityEntry.Entity);
        }
示例#2
0
        public async Task DeleteAsync(uint id)
        {
            using var db = new EfMealsDataModel(_options);
            var item = await db.Meals.FindAsync(id);

            db.Meals.Remove(item);
            await db.SaveChangesAsync().ConfigureAwait(true);
        }