示例#1
0
        public void Add(string section, string itemId)
        {
            if (Sections == null)
            {
                Sections = new List <FavoritesSection>();
            }
            var targetSection = Sections.FirstOrDefault(s => s.Name == section);

            if (targetSection == null)
            {
                targetSection = new FavoritesSection
                {
                    Name    = section,
                    ItemsId = new List <string>()
                };
                Sections.Add(targetSection);
            }
            targetSection.ItemsId.Add(itemId);
        }
示例#2
0
        public void Add(string section, string itemId)
        {
            if (Sections == null)
            {
                Sections = new List<FavoritesSection>();
            }
            var targetSection = Sections.FirstOrDefault(s => s.Name == section);

            if (targetSection == null)
            {
                targetSection = new FavoritesSection
                {
                    Name = section,
                    ItemsId = new List<string>()
                };
                Sections.Add(targetSection);
            }
            targetSection.ItemsId.Add(itemId);
        }