REST to a .Net Standard Library

Test REST in discord bot and WPF
Small improvements
This commit is contained in:
2019-03-16 12:22:52 +01:00
parent 081d9ae893
commit 2fe08f938a
22 changed files with 423 additions and 78 deletions

View File

@@ -15,11 +15,25 @@ namespace LaDOSE.Business.Service
{
}
public override Game AddOrUpdate(Game entity)
{
if (entity.Order == 0)
{
entity.Order = GetNextFreeOrder();
}
return base.AddOrUpdate(entity);
}
public override IEnumerable<Game> GetAll()
{
return _context.Game.Include(e => e.Seasons).ThenInclude(e=>e.Season).ToList();
}
public int GetNextFreeOrder()
{
int nextFreeOrder = _context.Game.Max(e => e.Order);
return ++nextFreeOrder;
}
}
}