当前位置: 首页>>代码示例>>C#>>正文


C# CustomizersHolder.AddCustomizer方法代码示例

本文整理汇总了C#中CustomizersHolder.AddCustomizer方法的典型用法代码示例。如果您正苦于以下问题:C# CustomizersHolder.AddCustomizer方法的具体用法?C# CustomizersHolder.AddCustomizer怎么用?C# CustomizersHolder.AddCustomizer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CustomizersHolder的用法示例。


在下文中一共展示了CustomizersHolder.AddCustomizer方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InvokeCustomizerOfDictionaryKeyManyToManyRelation

        public void InvokeCustomizerOfDictionaryKeyManyToManyRelation()
        {
            var propertyPath = new PropertyPath(null, ForClass<MyClass>.Property(x => x.MyDictionary));
            var customizersHolder = new CustomizersHolder();
            var elementMapper = new Mock<IMapKeyManyToManyMapper>();

            customizersHolder.AddCustomizer(propertyPath, (IMapKeyManyToManyMapper x) => x.Column("pizza"));
            customizersHolder.InvokeCustomizers(propertyPath, elementMapper.Object);

            elementMapper.Verify(x => x.Column(It.Is<string>(v => v == "pizza")), Times.Once());
        }
开发者ID:alvarezdaniel,项目名称:conformando-nhibernate,代码行数:11,代码来源:CustomizersHolderTest.cs

示例2: InvokeCustomizerOfCollectionOneToManyRelation

        public void InvokeCustomizerOfCollectionOneToManyRelation()
        {
            var propertyPath = new PropertyPath(null, ForClass<MyClass>.Property(x => x.MyCollection));
            var customizersHolder = new CustomizersHolder();
            var elementMapper = new Mock<IOneToManyMapper>();

            customizersHolder.AddCustomizer(propertyPath, (IOneToManyMapper x) => x.NotFound(NotFoundMode.Ignore));
            customizersHolder.InvokeCustomizers(propertyPath, elementMapper.Object);

            elementMapper.Verify(x => x.NotFound(It.Is<NotFoundMode>(v => v == NotFoundMode.Ignore)), Times.Once());
        }
开发者ID:alvarezdaniel,项目名称:conformando-nhibernate,代码行数:11,代码来源:CustomizersHolderTest.cs

示例3: InvokeCustomizerOfCollectionElementRelation

        public void InvokeCustomizerOfCollectionElementRelation()
        {
            var propertyPath = new PropertyPath(null, ForClass<MyClass>.Property(x => x.MyCollection));
            var customizersHolder = new CustomizersHolder();
            var elementMapper = new Mock<IElementMapper>();

            customizersHolder.AddCustomizer(propertyPath, (IElementMapper x) => x.Length(10));
            customizersHolder.InvokeCustomizers(propertyPath, elementMapper.Object);

            elementMapper.Verify(x => x.Length(It.Is<int>(v => v == 10)), Times.Once());
        }
开发者ID:alvarezdaniel,项目名称:conformando-nhibernate,代码行数:11,代码来源:CustomizersHolderTest.cs

示例4: MergeShouldMergeCollectionPropertiesMapper

		public void MergeShouldMergeCollectionPropertiesMapper()
		{
			var emptyHolder = new CustomizersHolder();
			var holder = new CustomizersHolder();
			var called = false;

			holder.AddCustomizer(propertyPath, (ICollectionPropertiesMapper x) => called = true);
			emptyHolder.Merge(holder);
			emptyHolder.InvokeCustomizers(propertyPath, (IBagPropertiesMapper)null);

			called.Should().Be.True();
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:12,代码来源:CustomizerHolderMergeTest.cs

示例5: MergeShouldMergeElementMapper

		public void MergeShouldMergeElementMapper()
		{
			var emptyHolder = new CustomizersHolder();
			var holder = new CustomizersHolder();
			var called = false;

			holder.AddCustomizer(propertyPath, (IElementMapper x) => called = true);
			emptyHolder.Merge(holder);
			emptyHolder.InvokeCustomizers(propertyPath, (IElementMapper)null);

			Assert.That(called, Is.True);
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:12,代码来源:CustomizerHolderMergeTest.cs

示例6: WhenRegisteredCustomizerForDictionaryThenCallElementMapperAction

        public void WhenRegisteredCustomizerForDictionaryThenCallElementMapperAction()
        {
            var orm = GetBaseMockedDomainInspector();
            orm.Setup(x => x.IsDictionary(It.Is<MemberInfo>(m => m == ForClass<Person>.Property(p => p.Farm)))).Returns(true);
            bool customizerInvoked = false;
            var propertyPath = new PropertyPath(null, ForClass<Person>.Property(p => p.Farm));
            var customizersHolder = new CustomizersHolder();
            customizersHolder.AddCustomizer(propertyPath, (IOneToManyMapper x) => customizerInvoked = true);

            var mapper = new Mapper(orm.Object, customizersHolder);
            mapper.CompileMappingFor(new[] { typeof(Person) });

            customizerInvoked.Should().Be.True();
        }
开发者ID:alvarezdaniel,项目名称:conformando-nhibernate,代码行数:14,代码来源:OneToManyCustomizersInvocationTest.cs

示例7: MergeShouldMergeDynamicComponentAttributesMapper

		public void MergeShouldMergeDynamicComponentAttributesMapper()
		{
			var emptyHolder = new CustomizersHolder();
			var holder = new CustomizersHolder();
			var called = false;

			holder.AddCustomizer(propertyPath, (IDynamicComponentAttributesMapper x) => called = true);
			emptyHolder.Merge(holder);
			emptyHolder.InvokeCustomizers(propertyPath, (IDynamicComponentAttributesMapper)null);

			called.Should().Be.True();
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:12,代码来源:CustomizerHolderMergeTest.cs

示例8: MergeShouldMergeComponentAttributesMapper

		public void MergeShouldMergeComponentAttributesMapper()
		{
			var emptyHolder = new CustomizersHolder();
			var holder = new CustomizersHolder();
			var called = false;

			holder.AddCustomizer(typeof(MyClass), (IComponentAttributesMapper x) => called = true);
			emptyHolder.Merge(holder);
			emptyHolder.InvokeCustomizers(typeof(MyClass), (IComponentAttributesMapper)null);

			called.Should().Be.True();
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:12,代码来源:CustomizerHolderMergeTest.cs

示例9: MergeShouldMergeMapKeyManyToManyMapper

		public void MergeShouldMergeMapKeyManyToManyMapper()
		{
			var emptyHolder = new CustomizersHolder();
			var holder = new CustomizersHolder();
			var called = false;

			holder.AddCustomizer(propertyPath, (IMapKeyManyToManyMapper x) => called = true);
			emptyHolder.Merge(holder);
			emptyHolder.InvokeCustomizers(propertyPath, (IMapKeyManyToManyMapper)null);

			called.Should().Be.True();
		}
开发者ID:NikGovorov,项目名称:nhibernate-core,代码行数:12,代码来源:CustomizerHolderMergeTest.cs

示例10: InvokingCustomizerOnListThenInvokeCollectionPropertiesCustomizer

        public void InvokingCustomizerOnListThenInvokeCollectionPropertiesCustomizer()
        {
            var propertyPath = new PropertyPath(null, ForClass<MyClass>.Property(x => x.MyCollection));
            var customizersHolder = new CustomizersHolder();
            var concreteCollectionMapper = new Mock<IListPropertiesMapper>();

            customizersHolder.AddCustomizer(propertyPath, (ICollectionPropertiesMapper x) => x.BatchSize(10));
            customizersHolder.InvokeCustomizers(propertyPath, concreteCollectionMapper.Object);

            concreteCollectionMapper.Verify(x => x.BatchSize(It.Is<int>(v => v == 10)), Times.Once());
        }
开发者ID:alvarezdaniel,项目名称:conformando-nhibernate,代码行数:11,代码来源:CustomizersHolderTest.cs

示例11: MergeShouldMergeUnionSubclassAttributesMapper

		public void MergeShouldMergeUnionSubclassAttributesMapper()
		{
			var emptyHolder = new CustomizersHolder();
			var holder = new CustomizersHolder();
			var called = false;

			holder.AddCustomizer(typeof(MyClass), (IUnionSubclassAttributesMapper x) => called = true);
			emptyHolder.Merge(holder);
			emptyHolder.InvokeCustomizers(typeof(MyClass), (IUnionSubclassAttributesMapper)null);

			Assert.That(called, Is.True);
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:12,代码来源:CustomizerHolderMergeTest.cs


注:本文中的CustomizersHolder.AddCustomizer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。