protected override IEnumerable <string> MergeDependencies(IJsonOrganization json, bool overwrite)
        {
            var properties = OrganizationPreferencesContext.Merge(json.Prefs, overwrite)
                             .Select(p => $"{nameof(Organization.Preferences)}.{p}")
                             .ToList();

            if (json.Actions != null)
            {
                Actions.Update(json.Actions.Select(a => a.GetFromCache <Action, IJsonAction>(Auth, overwrite)));
                properties.Add(nameof(Organization.Actions));
            }
            if (json.Boards != null)
            {
                Boards.Update(json.Boards.Select(a => a.GetFromCache <Board, IJsonBoard>(Auth, overwrite)));
                properties.Add(nameof(Organization.Boards));
            }
            if (json.Members != null)
            {
                Members.Update(json.Members.Select(a => a.GetFromCache <Member, IJsonMember>(Auth, overwrite)));
                properties.Add(nameof(Organization.Members));
            }
            if (json.Memberships != null)
            {
                Memberships.Update(json.Memberships.Select(a => a.TryGetFromCache <OrganizationMembership, IJsonOrganizationMembership>(overwrite) ??
                                                           new OrganizationMembership(a, Data.Id, Auth)));
                properties.Add(nameof(Organization.Memberships));
            }
            if (json.PowerUpData != null)
            {
                PowerUpData.Update(json.PowerUpData.Select(a => a.GetFromCache <PowerUpData, IJsonPowerUpData>(Auth, overwrite)));
                properties.Add(nameof(Organization.PowerUpData));
            }

            return(properties);
        }
예제 #2
0
        protected override IEnumerable <string> MergeDependencies(IJsonCard json, bool overwrite)
        {
            var properties = BadgesContext.Merge(json.Badges, overwrite)
                             .Select(p => $"{nameof(Card.Badges)}.{p}")
                             .ToList();

            if (json.Actions != null)
            {
                Actions.Update(json.Actions.Select(a => a.GetFromCache <Action, IJsonAction>(Auth, overwrite)));
                properties.Add(nameof(Card.Actions));
            }
            if (json.Attachments != null)
            {
                Attachments.Update(json.Attachments.Select(a => a.TryGetFromCache <Attachment, IJsonAttachment>(overwrite) ?? new Attachment(a, Data.Id, Auth)));
                properties.Add(nameof(Card.Attachments));
            }
            if (json.CheckLists != null)
            {
                CheckLists.Update(json.CheckLists.Select(a => a.GetFromCache <CheckList, IJsonCheckList>(Auth, overwrite)));
                properties.Add(nameof(Card.CheckLists));
            }
            if (json.Comments != null)
            {
                Comments.Update(json.Comments.Select(a => a.GetFromCache <Action, IJsonAction>(Auth, overwrite)));
                properties.Add(nameof(Card.Comments));
            }
            if (json.CustomFields != null)
            {
                CustomFields.Update(json.CustomFields.Select(a => a.GetFromCache <CustomField, IJsonCustomField>(Auth, overwrite, Data.Id)));
                properties.Add(nameof(Card.CustomFields));
            }
            if (json.Labels != null)
            {
                Labels.Update(json.Labels.Select(a => a.GetFromCache <Label, IJsonLabel>(Auth, overwrite)));
                properties.Add(nameof(Card.Labels));
            }
            if (json.Members != null)
            {
                Members.Update(json.Members.Select(a => a.GetFromCache <Member, IJsonMember>(Auth, overwrite)));
                properties.Add(nameof(Card.Members));
            }
            if (json.PowerUpData != null)
            {
                PowerUpData.Update(json.PowerUpData.Select(a => a.GetFromCache <PowerUpData, IJsonPowerUpData>(Auth, overwrite)));
                properties.Add(nameof(Card.PowerUpData));
            }
            if (json.Stickers != null)
            {
                Stickers.Update(json.Stickers.Select(a => a.TryGetFromCache <Sticker, IJsonSticker>(overwrite) ?? new Sticker(a, Data.Id, Auth)));
                properties.Add(nameof(Card.Stickers));
            }
            if (json.MembersVoted != null)
            {
                VotingMembers.Update(json.MembersVoted.Select(a => a.GetFromCache <Member, IJsonMember>(Auth, overwrite)));
                properties.Add(nameof(Card.VotingMembers));
            }

            return(properties);
        }
예제 #3
0
        protected override IEnumerable <string> MergeDependencies(IJsonBoard json, bool overwrite)
        {
            var properties = BoardPreferencesContext.Merge(json.Prefs, overwrite)
                             .Select(p => $"{nameof(Board.Preferences)}.{p}")
                             .ToList();

            if (json.Actions != null)
            {
                Actions.Update(json.Actions.Select(a => a.GetFromCache <Action, IJsonAction>(Auth, overwrite)));
                properties.Add(nameof(Board.Actions));
            }
            if (json.Cards != null)
            {
                Cards.Update(json.Cards.Select(a => a.GetFromCache <Card, IJsonCard>(Auth, overwrite)));
                properties.Add(nameof(Board.Cards));
            }
            if (json.CustomFields != null)
            {
                CustomFields.Update(json.CustomFields.Select(a => a.GetFromCache <CustomFieldDefinition>(Auth)));
                properties.Add(nameof(Board.CustomFields));
            }
            if (json.Labels != null)
            {
                Labels.Update(json.Labels.Select(a => a.GetFromCache <Label, IJsonLabel>(Auth, overwrite)));
                properties.Add(nameof(Board.Labels));
            }
            if (json.Lists != null)
            {
                Lists.Update(json.Lists.Select(a => a.GetFromCache <List, IJsonList>(Auth, overwrite)));
                properties.Add(nameof(Board.Lists));
            }
            if (json.Members != null)
            {
                Members.Update(json.Members.Select(a => a.GetFromCache <Member, IJsonMember>(Auth, overwrite)));
                properties.Add(nameof(Board.Members));
            }
            if (json.Memberships != null)
            {
                Memberships.Update(json.Memberships.Select(a => a.TryGetFromCache <BoardMembership, IJsonBoardMembership>(overwrite) ??
                                                           new BoardMembership(a, Data.Id, Auth)));
                properties.Add(nameof(Board.Memberships));
            }
            if (json.PowerUps != null)
            {
                PowerUps.Update(json.PowerUps.Select(a => a.GetFromCache <IPowerUp>(Auth)));
                properties.Add(nameof(Board.PowerUps));
            }
            if (json.PowerUpData != null)
            {
                PowerUpData.Update(json.PowerUpData.Select(a => a.GetFromCache <PowerUpData, IJsonPowerUpData>(Auth, overwrite)));
                properties.Add(nameof(Board.PowerUpData));
            }

            return(properties);
        }