Skip to content

Commit

Permalink
Use projection
Browse files Browse the repository at this point in the history
  • Loading branch information
SapiensAnatis committed Oct 31, 2024
1 parent 0b63c77 commit 78aa91f
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions DragaliaAPI/DragaliaAPI/Features/Fort/FortService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,14 @@ public async Task EndLevelup(long buildId)
{
logger.LogDebug(
"Building {@Build} has not finished levelling up. Current time: {Time}",
build,
new
{
build.BuildId,
build.PlantId,
build.Level,
build.BuildStartDate,
build.BuildEndDate,
},
time
);
throw new InvalidOperationException($"This building has not completed levelling up.");
Expand Down Expand Up @@ -509,8 +516,16 @@ private async Task Upgrade(FortPlantDetail plantDetail)
// Check Carpenter available
if (fortDetail.WorkingCarpenterNum >= fortDetail.CarpenterNum)
{
List<DbFortBuild> builds = await fortRepository
var builds = await fortRepository
.Builds.Where(x => x.BuildEndDate != DateTimeOffset.UnixEpoch)
.Select(x => new
{
x.BuildId,
x.PlantId,
x.Level,
x.BuildStartDate,
x.BuildEndDate,
})
.ToListAsync();

logger.LogDebug(
Expand Down

0 comments on commit 78aa91f

Please sign in to comment.