qol: user device assignment helper methods for expressions

This commit is contained in:
Gary Sharp
2025-08-13 16:15:53 +10:00
parent 53fdea5325
commit 676ff82e4b
2 changed files with 31 additions and 15 deletions
-15
View File
@@ -55,21 +55,6 @@ namespace Disco.Models.Repository
[InverseProperty(nameof(DeviceComment.Device))]
public virtual IList<DeviceComment> DeviceComments { get; set; }
/// <summary>
/// A list of the current device assignments, ordered by the most recent assignment date.
/// </summary>
[NotMapped]
public IList<DeviceUserAssignment> CurrentDeviceUserAssignments
{
get
{
return DeviceUserAssignments?
.Where(dua => dua.UnassignedDate is null)
.OrderByDescending(dua => dua.AssignedDate)
.ToList();
}
}
public override string ToString()
{
if (DeviceModel != null)