コード例 #1
0
        public static Configuration AddNamedSqlQuery(this Configuration configuration, string queryIdentifier, Action<INamedSqlQueryDefinitionBuilder> namedQueryDefinition)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            if (queryIdentifier == null)
            {
                throw new ArgumentNullException("queryIdentifier");
            }

            if (namedQueryDefinition == null)
            {
                throw new ArgumentNullException("namedQueryDefinition");
            }

            var builder = new NamedSqlQueryDefinitionBuilder();
            namedQueryDefinition(builder);
            configuration.NamedSQLQueries.Add(queryIdentifier, builder.Build());

            return configuration;
        }
コード例 #2
0
        public static Configuration AddNamedSqlQuery(this Configuration configuration, string queryIdentifier, Action <INamedSqlQueryDefinitionBuilder> namedQueryDefinition)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            if (queryIdentifier == null)
            {
                throw new ArgumentNullException("queryIdentifier");
            }

            if (namedQueryDefinition == null)
            {
                throw new ArgumentNullException("namedQueryDefinition");
            }

            var builder = new NamedSqlQueryDefinitionBuilder();

            namedQueryDefinition(builder);
            configuration.NamedSQLQueries.Add(queryIdentifier, builder.Build());

            return(configuration);
        }