Beispiel #1
0
        public async Task UpdateAdultsAsync(Adult person)
        {
            AdultContext dbContext = new AdultContext();

            dbContext.Update(person);
            await dbContext.SaveChangesAsync();
        }
Beispiel #2
0
        public async Task UpdateAdultAsync(Adult adult)
        {
            try
            {
                Adult toUpdate = await ctx.Adults.FirstAsync(t => t.Id == adult.Id);

                ctx.Update(toUpdate);
                await ctx.SaveChangesAsync();

                //return toUpdate;
            }
            catch (Exception e)
            {
                throw new Exception($"Did not find todo with id{adult.Id}");
            }
        }