Exemplo n.º 1
0
        public List <Title> OrderTitlesByBest()
        {
            List <Title> list = new List <Title>();

            foreach (TitleType type in Priority) // first find the types that need to be in a specifc order
            {
                Title title = Titles.FirstOrDefault(x => x?.Metadata.Type == type);
                if (title != null)
                {
                    list.Add(title);
                }
            }
            IEnumerable <Title> unorganized = Titles.Except(list); // then add the types that don't need to be organized afterwards

            list.AddRange(unorganized);
            return(list);
        }