DeliveryAncmtAdminWindow: Increase performace by aggregating AnnouncedWeight
All checks were successful
Test / Run tests (push) Successful in 2m23s
All checks were successful
Test / Run tests (push) Successful in 2m23s
This commit is contained in:
@@ -42,7 +42,9 @@ namespace Elwig.Models.Entities {
|
||||
[Column("max_weight")]
|
||||
public int? MaxWeight { get; set; }
|
||||
[NotMapped]
|
||||
public int AnnouncedWeight => Announcements.Sum(a => a.Weight);
|
||||
public int AnnouncedWeight => AnnouncedWeightOverride ?? Announcements.Sum(a => a.Weight);
|
||||
[NotMapped]
|
||||
public int? AnnouncedWeightOverride { get; set; }
|
||||
[NotMapped]
|
||||
public double? Percent => (double)AnnouncedWeight / MaxWeight * 100;
|
||||
|
||||
|
Reference in New Issue
Block a user