Till slut fick jag personvalet att fungera
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user