Beispiel #1
0
        public async Task <IWeb> AddBatchAsync(Batch batch, WebOptions webOptions)
        {
            var newWeb = CreateNewAndAdd() as Web;

            // Add the field options as arguments for the add method
            var additionalInfo = new Dictionary <string, object>()
            {
                { Web.WebOptionsAdditionalInformationKey, webOptions }
            };

            return(await newWeb.AddBatchAsync(batch, additionalInfo).ConfigureAwait(false) as Web);
        }
Beispiel #2
0
        public async Task <IWeb> AddAsync(WebOptions webOptions)
        {
            if (webOptions == null)
            {
                throw new ArgumentNullException(nameof(webOptions));
            }

            var newWeb = CreateNewAndAdd() as Web;

            // Add the field options as arguments for the add method
            var additionalInfo = new Dictionary <string, object>()
            {
                { Web.WebOptionsAdditionalInformationKey, webOptions }
            };

            return(await newWeb.AddAsync(additionalInfo).ConfigureAwait(false) as Web);
        }
Beispiel #3
0
 public IWeb AddBatch(Batch batch, WebOptions webOptions)
 {
     return(AddBatchAsync(batch, webOptions).GetAwaiter().GetResult());
 }
Beispiel #4
0
 public async Task <IWeb> AddBatchAsync(WebOptions webOptions)
 {
     return(await AddBatchAsync(PnPContext.CurrentBatch, webOptions).ConfigureAwait(false));
 }
Beispiel #5
0
 public IWeb Add(WebOptions webOptions)
 {
     return(AddAsync(webOptions).GetAwaiter().GetResult());
 }