예제 #1
0
 /// <param name='operations'>
 ///     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
 /// </param>
 /// <param name='authorization'>
 ///     Required. The authentication type and signature token. Both master
 ///     key and resource tokens are allowed for  operation.
 ///     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
 /// </param>
 /// <param name='contentType'>
 ///     Required. For creating a database, the Content-Type header must be
 ///     `<c>application/json</c>`.
 /// </param>
 /// <param name='xMSDate'>
 ///     Required. The date of the request The date is expressed in
 ///     Coordinated Universal Time format.
 ///     <example>
 ///         Fri, 08 Apr 2015
 ///         03:52:31 GMT
 ///     </example>
 /// </param>
 /// <param name='id'>
 ///     Required.  is a user settable property. It is the unique name
 ///     that identifies the collection
 /// </param>
 public static Database CreateDatabase(IDocumentDbConnector operations, string authorization,
                                       string contentType, string xMSDate, CustomBodyCollection id)
 {
     return
         (Task.Factory.StartNew(
              s => ((IDocumentDbConnector)s).CreateDatabaseAsync(authorization, contentType, xMSDate, id),
              operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default)
          .Unwrap()
          .GetAwaiter()
          .GetResult());
 }
 /// <summary>
 ///     Create a new Collection
 /// </summary>
 /// <param name='operations'>
 ///     Reference to the DocumentDBRestAPIClient.IDocumentDbConnector.
 /// </param>
 /// <param name='ridDB'>
 ///     Required. The Database Id
 /// </param>
 /// <param name='authorization'>
 ///     Required. The authentication type and signature token. Both master
 ///     key and resource tokens are allowed for  operation.
 ///     <c>type={typeoftoken}%26ver={tokenversion}%26sig={hashsignature}</c>
 /// </param>
 /// <param name='xMSDate'>
 ///     Required. The date of the request The date is expressed in
 ///     Coordinated Universal Time format.
 ///     <example>
 ///         Fri, 08 Apr
 ///         2015 03:52:31 GMT
 ///     </example>
 /// </param>
 /// <param name='xMSVersion'>
 ///     Required. The version of DocumentDB REST service. The latest
 ///     version is used when the header is not provided use
 ///     <c>2015-08-06</c>
 /// </param>
 /// <param name='id'>
 ///     Required.  is a user settable property. It is the unique name
 ///     that identifies the collection
 /// </param>
 public static Collection CreateCollection(IDocumentDbConnector operations, string ridDB,
                                           string authorization,
                                           string xMSDate, string xMSVersion, CustomBodyCollection id)
 {
     return
         (Task.Factory.StartNew(
              s => ((IDocumentDbConnector)s).CreateCollectionAsync(ridDB, authorization, xMSDate, xMSVersion,
                                                                   id), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default)
          .Unwrap()
          .GetAwaiter()
          .GetResult());
 }
 public Collection CreateCollection(IDocumentDbRestApi operations, string ridDB, string authorization,
                                    string xMSDate, string xMSVersion, CustomBodyCollection id)
 => operations.CreateCollection(ridDB, authorization, xMSDate, xMSVersion,
                                id);