Commit före flytt avStatusparameter från point till round
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user