public async Task SaveRanking(Ranking ranking) { if (ranking.Id == 0) { await context.AddAsync(ranking); } else { context.Entry(ranking).State = Microsoft.EntityFrameworkCore.EntityState.Modified; } await context.SaveChangesAsync(); }
public async Task SaveRoom(Room room) { if (room.Id == 0) { await context.AddAsync(room); } else { context.Entry(room).State = Microsoft.EntityFrameworkCore.EntityState.Modified; } await context.SaveChangesAsync(); }