Till slut fick jag personvalet att fungera

This commit is contained in:
2025-09-06 11:59:04 +02:00
parent d3c9dcb208
commit a2d47debfe
11 changed files with 223 additions and 46 deletions

View File

@ -41,20 +41,20 @@ public class GameRoundRepository : IRepository<GameRound>
return await _dataContext.GameRounds.FindAsync(id);
}
public async Task<bool> Save(GameRound entity)
public async Task<int> Save(GameRound entity)
{
var res = false;
var res = -1;
if (entity.GameRoundId == 0)
{
_dataContext.GameRounds.Add(entity);
await _dataContext.SaveChangesAsync();
res = true;
res = entity.GameRoundId;
}
else
{
_dataContext.GameRounds.Update(entity);
await _dataContext.SaveChangesAsync();
res = true;
res = entity.GameRoundId;
}
return res;
}