Exemplo n.º 1
0
        T CreateTableInternal <T>(TableSchema tableSchema, Func <Method, string, string, string, string, HttpStatusCode[], T> action)
        {
            string resource = ResourceBuilder.BuildTableSchemaAccess(tableSchema);

            ErrorProvider.ThrowIfSchemaInvalid(tableSchema);
            string data = Converter.ConvertSchema(tableSchema);

            return(action(Method.PUT, resource, Options.ContentType, Options.ContentType, data, new[] { HttpStatusCode.OK }));
        }
Exemplo n.º 2
0
        /// <summary>
        ///   Creates the table.
        /// </summary>
        /// <param name="tableSchema">The table schema.</param>
        public virtual void CreateTable(TableSchema tableSchema)
        {
            string resource = ResourceBuilder.BuildTableSchemaAccess(tableSchema);

            ErrorProvider.ThrowIfSchemaInvalid(tableSchema);
            string        data     = Converter.ConvertSchema(tableSchema);
            IRestResponse response = SendRequest(Method.PUT, resource, Options.ContentType, Options.ContentType, data);

            ErrorProvider.ThrowIfStatusMismatch(response, HttpStatusCode.OK);
        }