public Theme AddTheme(string name, string description, string iconUrl, List <Keyword> keywords = null, bool isTrending = false, Subplatform subplatform = null, byte[] image = null) { InitNonExistingRepo(); Theme theme = new Theme { Name = name, Description = description, IconURL = iconUrl, IsTrending = isTrending, Alerts = new List <Alert>(), Elements = new List <Element>(), SubscribedProfiles = new List <Profile>(), Keywords = keywords ?? new List <Keyword>(), SubPlatforms = new List <Subplatform>(), Image = image }; if (subplatform != null) { theme.SubPlatforms.Add(subplatform); subplatform.Items.Add(theme); } if (keywords != null) { keywords.ForEach(k => { if (k.Items == null) { k.Items = new List <Item>(); } k.Items.Add(theme); }); } theme = ItemRepo.CreateTheme(theme); UowManager.Save(); return(theme); }