public static IRelationshipsBuilder <TParentBuilder, TResource> AddRelationship <TParentBuilder, TResource>(this IRelationshipsBuilder <TParentBuilder, TResource> relationshipsBuilder, string rel, IEnumerable <Relationship> relationshipCollection)
            where TResource : class
        {
            Contract.Requires(relationshipsBuilder != null);

            return(relationshipsBuilder.AddRelationship(rel, default(Func <TResource, bool>), relationshipCollection));
        }
        public static IRelationshipsBuilder <TParentBuilder, TResource> AddRelationship <TParentBuilder, TResource>(this IRelationshipsBuilder <TParentBuilder, TResource> relationshipsBuilder, string rel, IEnumerable <string> linkRelCollection, IEnumerable <IToManyResourceLinkage> toManyResourceLinkageCollection)
            where TResource : class
        {
            Contract.Requires(relationshipsBuilder != null);

            return(relationshipsBuilder.AddRelationship(rel, default(Func <TResource, bool>), linkRelCollection, toManyResourceLinkageCollection));
        }
Пример #3
0
        // PUBLIC METHODS ///////////////////////////////////////////////////
        #region Extension Methods
        public static IRelationshipsBuilder <TParentBuilder, TResource> AddRelationship <TParentBuilder, TResource>(this IRelationshipsBuilder <TParentBuilder, TResource> relationshipsBuilder, string rel, Relationship relationship)
            where TParentBuilder : class
            where TResource : class, IResource
        {
            Contract.Requires(relationshipsBuilder != null);

            return(relationshipsBuilder.AddRelationship(rel, default(Func <TResource, bool>), relationship));
        }
        // PUBLIC METHODS ///////////////////////////////////////////////////
        #region Extension Methods
        public static IRelationshipsBuilder <TParentBuilder, TResource> AddRelationship <TParentBuilder, TResource, TResourceId>(this IRelationshipsBuilder <TParentBuilder, TResource> relationshipsBuilder, string rel, params TResourceId[] clrResourceIdCollection)
            where TParentBuilder : class
            where TResource : class, IResource
        {
            Contract.Requires(relationshipsBuilder != null);
            Contract.Requires(String.IsNullOrWhiteSpace(rel) == false);
            Contract.Requires(clrResourceIdCollection != null);

            return(relationshipsBuilder.AddRelationship(rel, clrResourceIdCollection.AsEnumerable()));
        }
        public static IRelationshipsBuilder <TParentBuilder, TResource> AddRelationship <TParentBuilder, TResource>(this IRelationshipsBuilder <TParentBuilder, TResource> relationshipsBuilder, string rel, Func <TResource, bool> predicate, params string[] linkRelCollection)
            where TParentBuilder : class
            where TResource : class, IResource
        {
            Contract.Requires(relationshipsBuilder != null);
            Contract.Requires(String.IsNullOrWhiteSpace(rel) == false);
            Contract.Requires(linkRelCollection != null);

            return(relationshipsBuilder.AddRelationship(rel, predicate, linkRelCollection.AsEnumerable()));
        }