Exemplo n.º 1
0
        /// <summary>
        /// Gets the <see cref="TableSchema"/> for the specified entityType and dialect.
        /// </summary>
        public static TableSchema GetTableSchema(Type entityType, IDialect dialect, TableSchemaFactory schemaFactory)
        {
            var key = new TableSchemaCacheIdentity(entityType, dialect.Name);

            if (Schemas.TryGetValue(key, out var result))
            {
                return(result);
            }

            var schema = schemaFactory.MakeTableSchema(entityType, dialect);

            Schemas[key] = schema;
            return(schema);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the <see cref="ConditionColumnSchema"/>s for the specified conditionsType and dialect.
        /// </summary>
        public static ImmutableArray <ConditionColumnSchema> GetConditionsSchema(
            Type entityType,
            TableSchema tableSchema,
            Type conditionsType,
            IDialect dialect,
            TableSchemaFactory schemaFactory)
        {
            var key = new ConditionsColumnCacheIdentity(conditionsType, entityType, dialect.Name);

            if (ConditionColumns.TryGetValue(key, out var result))
            {
                return(result);
            }

            var column = schemaFactory.MakeConditionsSchema(conditionsType, tableSchema);

            ConditionColumns[key] = column;
            return(column);
        }