Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ private static SingleCourseJson CreateCourseJson(Ranking ranking, CourseTable co
BasePath = basePath,
Year = ranking.Year,
School = ranking.School,
Location = course.Location
Location = course.Location,
RankingOrder = ranking.RankingOrder
};
}

Expand Down
10 changes: 9 additions & 1 deletion PoliNetwork.Graduatorie.Parser/Objects/RankingNS/Ranking.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace PoliNetwork.Graduatorie.Parser.Objects.RankingNS;

[Serializable]
[JsonObject(MemberSerialization.Fields, NamingStrategyType = typeof(CamelCaseNamingStrategy))]
public class Ranking
public class Ranking : IComparable<Ranking>
{
public List<CourseTable>? ByCourse;
public MeritTable? ByMerit;
Expand All @@ -35,6 +35,14 @@ public RankingSummaryStudent GetRankingSummaryStudent()
return new RankingSummaryStudent(RankingOrder?.Phase, School, Year, Url);
}

public int CompareTo(Ranking? other)
{
if (ReferenceEquals(this, other)) return 0;
if (ReferenceEquals(null, other)) return 1;

return string.Compare(GetId(), other.GetId(), StringComparison.Ordinal);
}


/***
* Ottieni l'hash senza considerare il valore di LastUpdate
Expand Down