Пример #1
0
 /// <summary>
 /// Updates the given object in the database
 /// </summary>
 /// <param name="obj">The updated object</param>
 /// <returns>async Task</returns>
 public virtual async Task UpdateObjectAsync(T obj)
 {
     await using (var context = new DimselabDbContext())
     {
         context.Set <T>().Update(obj);
         await context.SaveChangesAsync();
     }
 }
            public async Task AddObjectAsync(Booking obj)
            {
                await dbContext.Set <Booking>().AddAsync(obj);

                await dbContext.SaveChangesAsync();
            }
Пример #3
0
            public async Task AddObjectAsync(Item obj)
            {
                await dbContext.Set <Item>().AddAsync(obj);

                await dbContext.SaveChangesAsync();
            }
            public async Task AddObjectAsync(User obj)
            {
                await dbContext.Set <User>().AddAsync(obj);

                await dbContext.SaveChangesAsync();
            }