Commit före flytt avStatusparameter från point till round

This commit is contained in:
2025-09-13 08:43:17 +02:00
parent a2d47debfe
commit b4898660f2
13 changed files with 226 additions and 34 deletions

View File

@ -25,7 +25,7 @@ public class GamePointRepository : IRepository<GamePoint>
{
var res = -1;
if ((entity.GameRoundRegNr == 0)
|| (entity.GameRegPoints == 0))
&& (entity.GameRegPoints == 0))
{
return res; // Validation failed
}
@ -51,7 +51,7 @@ public class GamePointRepository : IRepository<GamePoint>
try
{
_dataContext.GamePoints.Remove(entity);
_dataContext.SaveChanges();
_dataContext.SaveChangesAsync();
res = true;
}
catch (Exception ex)
@ -62,6 +62,22 @@ public class GamePointRepository : IRepository<GamePoint>
return res;
}
public async Task<bool> DeleteById(int Id)
{
var ok = false;
var delObject = await this.Get(Id);
if (delObject != null)
{
try
{
ok = this.Delete(delObject);
}
catch (Exception ex)
{
throw new Exception("Unsuccessful remove of GamePoint: " + ex.Message);
}
}
return ok;
}
}