예제 #1
0
        /// <summary>
        /// Creates a new Team Site Collection with no group
        /// </summary>
        /// <param name="clientContext">ClientContext object of a regular site</param>
        /// <param name="siteCollectionCreationInformation">information about the site to create</param>
        /// <param name="delayAfterCreation">Defines the number of seconds to wait after creation</param>
        /// <returns>ClientContext object for the created site collection</returns>
        public static async Task <ClientContext> CreateAsync(ClientContext clientContext, TeamNoGroupSiteCollectionCreationInformation siteCollectionCreationInformation, Int32 delayAfterCreation = 0)
        {
            Dictionary <string, object> payload = GetRequestPayload(siteCollectionCreationInformation);

            return(await CreateAsync(clientContext, siteCollectionCreationInformation.Owner, payload, delayAfterCreation));
        }
예제 #2
0
        /// <summary>
        /// Creates a new Team Site Collection with no group and waits for it to be created
        /// </summary>
        /// <param name="clientContext">ClientContext object of a regular site</param>
        /// <param name="siteCollectionCreationInformation">information about the site to create</param>
        /// <param name="delayAfterCreation">Defines the number of seconds to wait after creation</param>
        /// <returns>ClientContext object for the created site collection</returns>
        public static ClientContext Create(ClientContext clientContext, TeamNoGroupSiteCollectionCreationInformation siteCollectionCreationInformation, Int32 delayAfterCreation = 0)
        {
            var context = CreateAsync(clientContext, siteCollectionCreationInformation, delayAfterCreation).GetAwaiter().GetResult();

            return(context);
        }