private Benchmark(string host, ushort port, string database, string verb, ITermSet termset) { this.host = host; this.port = port; this.database = database; this.verb = verb; this.times = new ArrayList(); this.termset = termset; }
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); }
public async Task <ITermRelation> AddAsync(TermRelationType relationship, ITermSet targetSet, ITerm fromTerm = null) { if (targetSet == null) { throw new ArgumentNullException(nameof(targetSet)); } TermRelation newTermRelation = PrepNewTermRelation(relationship, targetSet, fromTerm); return(await newTermRelation.AddAsync().ConfigureAwait(false) as TermRelation); }
public async Task <IActionResult> Run( [HttpTrigger(AuthorizationLevel.Function, "post", Route = "term/{name}")] HttpRequest req, string name) { using (var pnpContext = await _pnpContextFactory.CreateAsync("Default")) { _logger.LogInformation("Creating Term '{DefaultLabel}'", name); try { ITermGroup termGroup = pnpContext.TermStore.Groups.First(); ITermSet termSet = termGroup.Sets.First(); var newTerm = await termSet.Terms.AddAsync(name); return(new OkObjectResult(new { id = newTerm.Id })); } catch (MicrosoftGraphServiceException ex) { _logger.LogError((Exception)ex, ex.Error.ToString()); return(new BadRequestObjectResult(ex.Error)); } } }
public TermSetController(ITermSet _spTermsService, IConfiguration _config) { this._spTermsService = _spTermsService; this._config = _config; }
public ITermRelation AddBatch(TermRelationType relationship, ITermSet targetSet, ITerm fromTerm = null) { return(AddBatchAsync(relationship, targetSet, fromTerm).GetAwaiter().GetResult()); }
public async Task <ITermRelation> AddBatchAsync(TermRelationType relationship, ITermSet targetSet, ITerm fromTerm = null) { return(await AddBatchAsync(PnPContext.CurrentBatch, relationship, targetSet, fromTerm).ConfigureAwait(false)); }