Closed MrWalshyType2 closed 3 years ago
Changed LastAttempt property to reference a field for control of get and set methods
[NotMapped]
private SpacedRepetitionAttempt lastAttempt;
[NotMapped]
public SpacedRepetitionAttempt LastAttempt
{
get
{
List<SpacedRepetitionAttempt> attempts = null;
SpacedRepetitionAttempt lastAttempt = null;
var attemptQuery = from a in SpacedRepetitionAttempts
orderby a.AttemptDate descending
select a;
if (attemptQuery.Any())
{
attempts = attemptQuery.ToList();
lastAttempt = attempts[0];
return lastAttempt;
}
return null;
}
set
{
this.lastAttempt = value;
}
}