public async Task <bool> PostTypeMusicLocal(TypeMusicLocal typeMusicLocal) { _context.TypeMusicLocals.Add(typeMusicLocal); await _context.SaveChangesAsync(); return(true); }
public async Task <bool> PutTypeMusicLocal(int id, TypeMusicLocal typeMusicLocal) { if (id != typeMusicLocal.Id) { return(false); } _context.Entry(typeMusicLocal).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TypeMusicLocalExists(id)) { return(false); } else { throw; } } return(true); }