diff --git a/Tevling/Data/DataContext.cs b/Tevling/Data/DataContext.cs index 238ce6f..c0bd8b9 100644 --- a/Tevling/Data/DataContext.cs +++ b/Tevling/Data/DataContext.cs @@ -44,6 +44,10 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) e => e.HasOne().WithMany().HasForeignKey(e => e.FolloweeId), e => e.HasOne().WithMany().HasForeignKey(e => e.FollowerId)); + modelBuilder.Entity() + .Property(a => a.Created) + .HasConversion(new DateTimeOffsetToBinaryConverter()); + modelBuilder.Entity() .HasOne(c => c.CreatedBy); diff --git a/Tevling/Services/AthleteService.cs b/Tevling/Services/AthleteService.cs index 0b98ed6..090e21a 100644 --- a/Tevling/Services/AthleteService.cs +++ b/Tevling/Services/AthleteService.cs @@ -219,6 +219,7 @@ public async Task GetSuggestedAthletesToFollowAsync(int athleteId, Ca .Except(followedAthleteIds) .Contains(a.Id) && a.Id != athleteId) + .OrderBy(a => a.Created) .Take(5) .ToArrayAsync(ct);