コード例 #1
0
        /// <summary>
        /// Creates a new instance of the <see cref="SqlTableConfigBuilder"/>.
        /// </summary>
        /// <param name="tableName">The table name.</param>
        /// <param name="uniqueKey">The unique key columns.</param>
        /// <returns>The <see cref="SqlTableConfigBuilder"/>.</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="tableName"/> or <paramref name="uniqueKey"/> is <c>null</c>.</exception>
        public static SqlTableConfigBuilder Create(TableExpressionDelegate tableName, string[] uniqueKey)
        {
            if (tableName == null)
            {
                throw new ArgumentNullException(nameof(tableName));
            }
            if (uniqueKey == null)
            {
                throw new ArgumentNullException(nameof(uniqueKey));
            }

            var config = new SqlTableConfig(tableName, uniqueKey);

            return(new SqlTableConfigBuilder(config));
        }
コード例 #2
0
        /// <summary>
        /// Configure the SQL table for the graph type.
        /// </summary>
        /// <param name="typeConfig">The type config.</param>
        /// <param name="table">The table expression.</param>
        /// <param name="uniqueKey">The unique key column.</param>
        /// <returns>The <see cref="SqlTableConfigBuilder"/>.</returns>
        /// <exception cref="ArgumentNullException">If <paramref name="typeConfig"/>, <paramref name="table"/> or <paramref name="uniqueKey"/> is <c>null</c>.</exception>
        public static SqlTableConfigBuilder SqlTable(this TypeConfig typeConfig, TableExpressionDelegate table, string[] uniqueKey)
        {
            if (typeConfig == null)
            {
                throw new ArgumentNullException(nameof(typeConfig));
            }
            if (table == null)
            {
                throw new ArgumentNullException(nameof(table));
            }
            if (uniqueKey == null)
            {
                throw new ArgumentNullException(nameof(uniqueKey));
            }

            var builder = SqlTableConfigBuilder.Create(table, uniqueKey);

            typeConfig.WithMetadata(nameof(SqlTableConfig), builder.SqlTableConfig);
            return(builder);
        }
コード例 #3
0
 /// <summary>
 /// Creates a new instance of <see cref="SqlTableConfig"/>.
 /// </summary>
 /// <param name="table">The table name.</param>
 /// <param name="uniqueKey">The unique key columns.</param>
 public SqlTableConfig(TableExpressionDelegate table, string[] uniqueKey)
 {
     Table     = table ?? throw new ArgumentNullException(nameof(table));
     UniqueKey = uniqueKey ?? throw new ArgumentNullException(nameof(uniqueKey));
 }
コード例 #4
0
 /// <summary>
 /// Configure the SQL table for the graph type.
 /// </summary>
 /// <param name="typeConfig">The type config.</param>
 /// <param name="table">The table expression.</param>
 /// <param name="uniqueKey">The unique key column.</param>
 /// <returns>The <see cref="SqlTableConfigBuilder"/>.</returns>
 /// <exception cref="ArgumentNullException">If <paramref name="typeConfig"/>, <paramref name="table"/> or <paramref name="uniqueKey"/> is <c>null</c>.</exception>
 public static SqlTableConfigBuilder SqlTable(this TypeConfig typeConfig, TableExpressionDelegate table, string uniqueKey) =>
 SqlTable(typeConfig, table, new[] { uniqueKey });
コード例 #5
0
 /// <summary>
 /// Configure the SQL table for the graph type.
 /// </summary>
 /// <param name="graphType">The graph type.</param>
 /// <param name="table">The table expression.</param>
 /// <param name="uniqueKey">The unique key column.</param>
 /// <returns>The <see cref="SqlTableConfigBuilder"/>.</returns>
 /// <exception cref="ArgumentNullException">If <paramref name="graphType"/>, <paramref name="table"/> or <paramref name="uniqueKey"/> is <c>null</c>.</exception>
 public static SqlTableConfigBuilder SqlTable(this IGraphType graphType, TableExpressionDelegate table, string uniqueKey) =>
 SqlTable(graphType, table, new[] { uniqueKey });