Fixed server creation allocation loading
This commit is contained in:
@@ -68,7 +68,15 @@
|
|||||||
.Include(x => x.Node);
|
.Include(x => x.Node);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<ServerAllocation> LoadFreeAllocations(Repository<ServerAllocation> repository, Server currentServer)
|
private IEnumerable<ServerAllocation> LoadFreeAllocations(Repository<ServerAllocation> repository, Server? currentServer)
|
||||||
|
{
|
||||||
|
if (currentServer == null)
|
||||||
|
{
|
||||||
|
return repository
|
||||||
|
.Get()
|
||||||
|
.FromSqlRaw("SELECT * FROM `ServerAllocations` WHERE ServerId IS NULL");
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
return currentServer.Allocations.Concat(
|
return currentServer.Allocations.Concat(
|
||||||
repository
|
repository
|
||||||
@@ -77,6 +85,7 @@
|
|||||||
.AsEnumerable() // => executes the sql
|
.AsEnumerable() // => executes the sql
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async Task CustomAdd(Server form) => await ServerService.Create(form);
|
private async Task CustomAdd(Server form) => await ServerService.Create(form);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user