コード例 #1
0
ファイル: ReaderUtils.cs プロジェクト: tapika/swupd
        /// <summary>
        /// Creates a new <see cref="ODataEntry"/> instance to return to the user.
        /// </summary>
        /// <returns>The newly created entry.</returns>
        /// <remarks>The method populates the Properties property with an empty read only enumeration.</remarks>
        internal static ODataEntry CreateNewEntry()
        {
            DebugUtils.CheckNoExternalCallers();

            return(new ODataEntry
            {
                Properties = new ReadOnlyEnumerable <ODataProperty>(),
                AssociationLinks = ReadOnlyEnumerable <ODataAssociationLink> .Empty(),
                Actions = ReadOnlyEnumerable <ODataAction> .Empty(),
                Functions = ReadOnlyEnumerable <ODataFunction> .Empty()
            });
        }
コード例 #2
0
        /// <summary>
        /// Creates a new instance of ATOM feed metadata.
        /// </summary>
        /// <returns>The newly created ATOM feed metadata.</returns>
        internal static AtomFeedMetadata CreateNewAtomFeedMetadata()
        {
            DebugUtils.CheckNoExternalCallers();

            return(new AtomFeedMetadata
            {
                Authors = ReadOnlyEnumerable <AtomPersonMetadata> .Empty(),
                Categories = ReadOnlyEnumerable <AtomCategoryMetadata> .Empty(),
                Contributors = ReadOnlyEnumerable <AtomPersonMetadata> .Empty(),
                Links = ReadOnlyEnumerable <AtomLinkMetadata> .Empty(),
            });
        }
コード例 #3
0
 /// <summary>
 /// true if <paramref name="source"/> is the same instance as ReadOnlyEnumerableOfT.Empty(). false otherwise.
 /// </summary>
 /// <typeparam name="T">The element type of the enumerable.</typeparam>
 /// <param name="source">The enumerable in question.</param>
 /// <returns>Returns true if <paramref name="source"/> is the empty ReadOnlyEnumerableOfT. false otherwise.</returns>
 internal static bool IsEmptyReadOnlyEnumerable <T>(this IEnumerable <T> source)
 {
     DebugUtils.CheckNoExternalCallers();
     return(ReferenceEquals(source, ReadOnlyEnumerable <T> .Empty()));
 }