internal static void AddLinkToFeedMetadata(AtomFeedMetadata feedMetadata, AtomLinkMetadata linkMetadata)
 {
     if (object.ReferenceEquals(feedMetadata.Links, EmptyLinksList))
     {
         feedMetadata.Links = new ReadOnlyEnumerable <AtomLinkMetadata>();
     }
     ReaderUtils.GetSourceListOfEnumerable <AtomLinkMetadata>(feedMetadata.Links, "Links").Add(linkMetadata);
 }
 internal static void AddContributorToFeedMetadata(AtomFeedMetadata feedMetadata, AtomPersonMetadata contributorMetadata)
 {
     if (object.ReferenceEquals(feedMetadata.Contributors, EmptyPersonsList))
     {
         feedMetadata.Contributors = new ReadOnlyEnumerable <AtomPersonMetadata>();
     }
     ReaderUtils.GetSourceListOfEnumerable <AtomPersonMetadata>(feedMetadata.Contributors, "Contributors").Add(contributorMetadata);
 }
 internal static void AddCategoryToFeedMetadata(AtomFeedMetadata feedMetadata, AtomCategoryMetadata categoryMetadata)
 {
     if (object.ReferenceEquals(feedMetadata.Categories, EmptyCategoriesList))
     {
         feedMetadata.Categories = new ReadOnlyEnumerable <AtomCategoryMetadata>();
     }
     ReaderUtils.GetSourceListOfEnumerable <AtomCategoryMetadata>(feedMetadata.Categories, "Categories").Add(categoryMetadata);
 }
 internal static void AddAuthorToEntryMetadata(AtomEntryMetadata entryMetadata, AtomPersonMetadata authorMetadata)
 {
     if (object.ReferenceEquals(entryMetadata.Authors, EmptyPersonsList))
     {
         entryMetadata.Authors = new ReadOnlyEnumerable <AtomPersonMetadata>();
     }
     ReaderUtils.GetSourceListOfEnumerable <AtomPersonMetadata>(entryMetadata.Authors, "Authors").Add(authorMetadata);
 }
        /// <summary>
        /// Adds a new contributor to entry metadata.
        /// </summary>
        /// <param name="entryMetadata">The entry metadata to add the contributor to.</param>
        /// <param name="contributorMetadata">The contributor metadata to add.</param>
        internal static void AddContributorToEntryMetadata(AtomEntryMetadata entryMetadata, AtomPersonMetadata contributorMetadata)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(entryMetadata != null, "entryMetadata != null");
            Debug.Assert(contributorMetadata != null, "contributorMetadata != null");

            if (object.ReferenceEquals(entryMetadata.Contributors, EmptyPersonsList))
            {
                entryMetadata.Contributors = new ReadOnlyEnumerable <AtomPersonMetadata>();
            }

            ReaderUtils.GetSourceListOfEnumerable(entryMetadata.Contributors, "Contributors").Add(contributorMetadata);
        }
        /// <summary>
        /// Adds a new author to feed metadata.
        /// </summary>
        /// <param name="feedMetadata">The feed metadata to add the author to.</param>
        /// <param name="authorMetadata">The author metadata to add.</param>
        internal static void AddAuthorToFeedMetadata(AtomFeedMetadata feedMetadata, AtomPersonMetadata authorMetadata)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(feedMetadata != null, "feedMetadata != null");
            Debug.Assert(authorMetadata != null, "authorMetadata != null");

            if (object.ReferenceEquals(feedMetadata.Authors, EmptyPersonsList))
            {
                feedMetadata.Authors = new ReadOnlyEnumerable <AtomPersonMetadata>();
            }

            ReaderUtils.GetSourceListOfEnumerable(feedMetadata.Authors, "Authors").Add(authorMetadata);
        }
        /// <summary>
        /// Adds a new category to feed metadata.
        /// </summary>
        /// <param name="feedMetadata">The feed metadata to add the category to.</param>
        /// <param name="categoryMetadata">The category metadata to add.</param>
        internal static void AddCategoryToFeedMetadata(AtomFeedMetadata feedMetadata, AtomCategoryMetadata categoryMetadata)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(feedMetadata != null, "feedMetadata != null");
            Debug.Assert(categoryMetadata != null, "categoryMetadata != null");

            if (object.ReferenceEquals(feedMetadata.Categories, EmptyCategoriesList))
            {
                feedMetadata.Categories = new ReadOnlyEnumerable <AtomCategoryMetadata>();
            }

            ReaderUtils.GetSourceListOfEnumerable(feedMetadata.Categories, "Categories").Add(categoryMetadata);
        }
        /// <summary>
        /// Adds a new link to feed metadata.
        /// </summary>
        /// <param name="feedMetadata">The feed metadata to add the link to.</param>
        /// <param name="linkMetadata">The link metadata to add.</param>
        internal static void AddLinkToFeedMetadata(AtomFeedMetadata feedMetadata, AtomLinkMetadata linkMetadata)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(feedMetadata != null, "feedMetadata != null");
            Debug.Assert(linkMetadata != null, "linkMetadata != null");

            if (object.ReferenceEquals(feedMetadata.Links, EmptyLinksList))
            {
                feedMetadata.Links = new ReadOnlyEnumerable <AtomLinkMetadata>();
            }

            ReaderUtils.GetSourceListOfEnumerable(feedMetadata.Links, "Links").Add(linkMetadata);
        }
Example #9
0
        /// <summary>
        /// Adds an ODataFunction to an entry.
        /// </summary>
        /// <param name="entry">The entry to add the function.</param>
        /// <param name="function">The function to add.</param>
        internal static void AddFunctionToEntry(ODataEntry entry, ODataFunction function)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(entry != null, "entry != null");
            Debug.Assert(function != null, "function != null");

            if (object.ReferenceEquals(entry.Functions, EmptyFunctionsList))
            {
                entry.Functions = new ReadOnlyEnumerable <ODataFunction>();
            }

            ReaderUtils.GetSourceListOfEnumerable(entry.Functions, "Functions").Add(function);
        }
Example #10
0
        /// <summary>
        /// Adds an association link to an entry.
        /// </summary>
        /// <param name="entry">The entry to add the association link to.</param>
        /// <param name="associationLink">The association link to add.</param>
        internal static void AddAssociationLinkToEntry(ODataEntry entry, ODataAssociationLink associationLink)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(entry != null, "entry != null");
            Debug.Assert(associationLink != null, "associationLink != null");

            if (object.ReferenceEquals(entry.AssociationLinks, EmptyAssociationLinksList))
            {
                entry.AssociationLinks = new ReadOnlyEnumerable <ODataAssociationLink>();
            }

            ReaderUtils.GetSourceListOfEnumerable(entry.AssociationLinks, "AssociationLinks").Add(associationLink);
        }