public async Task <IActionResult> PutPet(long id, Pet pet) { if (id != pet.Id) { return(BadRequest()); } _context.Entry(pet).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PetExists(id)) { return(NotFound()); } else { throw; } } return(Ok(pet)); }
public async Task Add(TbPetCategory t) { context.Add(t); await context.SaveChangesAsync(); }
public async Task Add(TbFile t) { context.TbFile.Add(t); await context.SaveChangesAsync(); }
public async Task AddAsync(TEntity entity) { await DbSet.AddAsync(entity); await Db.SaveChangesAsync(); }