Example #1
0
        public async Task <ITermRelation> AddBatchAsync(Batch batch, TermRelationType relationship, ITermSet targetSet, ITerm fromTerm = null)
        {
            if (targetSet == null)
            {
                throw new ArgumentNullException(nameof(targetSet));
            }

            TermRelation newTermRelation = PrepNewTermRelation(relationship, targetSet, fromTerm);

            return(await newTermRelation.AddBatchAsync(batch).ConfigureAwait(false) as TermRelation);
        }
Example #2
0
        private TermRelation PrepNewTermRelation(TermRelationType relationship, ITermSet targetSet, ITerm fromTerm)
        {
            var newTermRelation = CreateNewAndAdd() as TermRelation;

            // Assign field values
            newTermRelation.Relationship = relationship;
            newTermRelation.Set          = targetSet;
            newTermRelation.FromTerm     = fromTerm;

            return(newTermRelation);
        }
Example #3
0
 public ITermRelation AddBatch(TermRelationType relationship, ITermSet targetSet, ITerm fromTerm = null)
 {
     return(AddBatchAsync(relationship, targetSet, fromTerm).GetAwaiter().GetResult());
 }
Example #4
0
 public async Task <ITermRelation> AddBatchAsync(TermRelationType relationship, ITermSet targetSet, ITerm fromTerm = null)
 {
     return(await AddBatchAsync(PnPContext.CurrentBatch, relationship, targetSet, fromTerm).ConfigureAwait(false));
 }