<commit_before>﻿using System.Collections.Generic;
using System.Linq;
using Snittlistan.Web.Areas.V2.ReadModels;

namespace Snittlistan.Web.Areas.V2.ViewModels
{
    public static class ExtensionMethods
    {
        private static readonly Dictionary<string, int> TeamLevelSortOrder = new Dictionary<string, int>
            {
                { "A", 1 },
                { "F", 2 },
                { "B", 3 },
                { "C", 4 }
            };

        public static IEnumerable<RosterViewModel> SortRosters(this IEnumerable<RosterViewModel> rosters)
        {
            return rosters.OrderBy(r => TeamLevelSortOrder[r.TeamLevel]).ThenBy(r => r.Date);
        }

        public static IEnumerable<ResultHeaderReadModel> SortResults(this IEnumerable<ResultHeaderReadModel> results)
        {
            return results.OrderBy(r => TeamLevelSortOrder[r.TeamLevel]).ThenBy(r => r.Date);
        }
    }
}<commit_msg>Fixes sorting problem<commit_after>﻿using System.Collections.Generic;
using System.Linq;
using Snittlistan.Web.Areas.V2.ReadModels;

namespace Snittlistan.Web.Areas.V2.ViewModels
{
    public static class ExtensionMethods
    {
        private static readonly Dictionary<string, int> TeamLevelSortOrder = new Dictionary<string, int>
            {
                { "A", 1 },
                { "F", 2 },
                { "B", 3 },
                { "C", 4 }
            };

        public static IEnumerable<RosterViewModel> SortRosters(this IEnumerable<RosterViewModel> rosters)
        {
            return rosters.OrderBy(r => TeamLevelSortOrder[r.TeamLevel]).ThenBy(r => r.Date);
        }

        public static IEnumerable<ResultHeaderReadModel> SortResults(this IEnumerable<ResultHeaderReadModel> results)
        {
            return results.OrderBy(r => TeamLevelSortOrder[r.TeamLevel.ToUpper()]).ThenBy(r => r.Date);
        }
    }
}
{'fraction_non_alphanumeric': 0.10962566844919786, 'fraction_numerical': 0.006417112299465241, 'mean_word_length': 2.401818181818182, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1083079', 'n_tokens_mistral': 553, 'n_tokens_neox': 528, 'n_words': 100}