/// <summary>
        ///     Allows configuration of the properties that this convention applies to.
        /// </summary>
        /// <param name="propertyConfigurationAction">
        ///     An action that performs configuration against a
        ///     <see
        ///         cref="ConventionPrimitivePropertyConfiguration" />
        ///     .
        /// </param>
        public void Configure(Action <ConventionPrimitivePropertyConfiguration> propertyConfigurationAction)
        {
            Check.NotNull(propertyConfigurationAction, "propertyConfigurationAction");

            _conventionsConfiguration.Add(
                new PropertyConvention(
                    _predicates,
                    propertyConfigurationAction));
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Allows configuration of the entity types that this convention applies to.
        /// </summary>
        /// <param name="entityConfigurationAction">
        ///     An action that performs configuration against a <see cref="ConventionTypeConfiguration" />
        ///     using a captured value.
        /// </param>
        public void Configure(Action <ConventionTypeConfiguration, T> entityConfigurationAction)
        {
            Check.NotNull(entityConfigurationAction, "entityConfigurationAction");

            _conventionsConfiguration.Add(
                new TypeConventionWithHaving <T>(
                    _predicates,
                    _capturingPredicate,
                    entityConfigurationAction));
        }
        public void Configure(Action <LightweightEntityConfiguration <T>, TValue> entityConfigurationAction)
        {
            Check.NotNull(entityConfigurationAction, "entityConfigurationAction");

            _conventionsConfiguration.Add(
                new EntityConventionOfTypeWithHaving <T, TValue>(
                    _predicates,
                    _capturingPredicate,
                    entityConfigurationAction));
        }
        /// <summary>
        /// Allows configuration of the properties that this convention applies to.
        /// </summary>
        /// <param name="propertyConfigurationAction">
        /// An action that performs configuration against a <see cref="ConventionPrimitivePropertyConfiguration" />
        /// using a captured value.
        /// </param>
        public void Configure(Action <ConventionPrimitivePropertyConfiguration, T> propertyConfigurationAction)
        {
            Check.NotNull(propertyConfigurationAction, "propertyConfigurationAction");

            _conventionsConfiguration.Add(
                new PropertyConventionWithHaving <T>(
                    _predicates,
                    _capturingPredicate,
                    propertyConfigurationAction));
        }
        public void Add_should_append_convention_on_to_internal_list()
        {
            var mockConvention1          = new Mock <IConvention>();
            var mockConvention2          = new Mock <IConvention>();
            var conventionsConfiguration = new ConventionsConfiguration(new[] { mockConvention1.Object });

            conventionsConfiguration.Add(mockConvention2.Object);

            Assert.Equal(2, conventionsConfiguration.Conventions.Count());
            Assert.Same(mockConvention2.Object, conventionsConfiguration.Conventions.Last());
        }
        public void Configure(Action <ConventionTypeConfiguration <T> > entityConfigurationAction)
        {
            Check.NotNull(entityConfigurationAction, "entityConfigurationAction");

            _conventionsConfiguration.Add(new TypeConvention <T>(_predicates, entityConfigurationAction));
        }
        /// <summary>
        ///     Allows configuration of the entity types that this convention applies to.
        /// </summary>
        /// <param name="entityConfigurationAction">
        ///     An action that performs configuration against a
        ///     <see
        ///         cref="LightweightEntityConfiguration" />
        ///     .
        /// </param>
        public void Configure(Action <LightweightEntityConfiguration> entityConfigurationAction)
        {
            Check.NotNull(entityConfigurationAction, "entityConfigurationAction");

            _conventionsConfiguration.Add(new EntityConvention(_predicates, entityConfigurationAction));
        }