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


C# ClassMap.Component方法代码示例

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


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

示例1: establish_context

        public override void establish_context()
        {
            inline_component = new ClassMap<Target>();
            inline_component.Component(x => x.ComponentProperty, c => c.Map(x => x.Property));

            external_component = new ComponentMap<Component>();
            external_component.Map(x => x.Property);

            reference_component = new ClassMap<Target>();
            reference_component.Component(x => x.ComponentProperty);
        }
开发者ID:JamesKovacs,项目名称:fluent-nhibernate,代码行数:11,代码来源:ExternalComponentOutputSpecs.cs

示例2: Mapping

        private void Mapping(Action<ComponentPart<ComponentTarget>> mappingDefinition)
        {
            var classMap = new ClassMap<PropertyTarget>();
            classMap.Id(x => x.Id);
            var map = classMap.Component(x => x.Component, mappingDefinition);

            mappingDefinition(map);

            mapping = classMap;
            mappingType = typeof(PropertyTarget);
        }
开发者ID:nsreddy1986,项目名称:fluent-nhibernate,代码行数:11,代码来源:ComponentConventionTests.cs

示例3: establish_context

        public override void establish_context()
        {
            var component_map = new ComponentMap<Component>();
            component_map.Map(x => x.Property);

            var class_map = new ClassMap<Target>();
            class_map.Component(x => x.Component);

            persistence_model = new PersistenceModel();
            persistence_model.Add(class_map);
            persistence_model.Add(component_map);
        }
开发者ID:roend83,项目名称:fluent-nhibernate,代码行数:12,代码来源:ComponentMapSpecs.cs

示例4: CanMapComponent

        public void CanMapComponent()
        {
            var classMap = new ClassMap<SalaryEmployee>();
            classMap.Component(x => x.Salary, c =>
                {
                    c.Map(x => x.Amount);
                    c.Map(x => x.Currency);
                });

            var classmapping = classMap.GetClassMapping();
            ComponentMapping componentMapping = classmapping.Components.FirstOrDefault();
            componentMapping.ShouldNotBeNull();
            componentMapping.Properties.ShouldHaveCount(2);
        }
开发者ID:paulbatum,项目名称:Fluent-NHibernate-Semantic-Model-Rewrite,代码行数:14,代码来源:ClassMapTester.cs

示例5: VerifyModel

        private void VerifyModel(Action<ComponentMapping> modelVerification)
        {
            var classMap = new ClassMap<PropertyTarget>();
            var map = classMap.Component(x => x.Component, m => {});

            model.Add(classMap);

            var generatedModels = model.BuildMappings();
            var modelInstance = (ComponentMapping)generatedModels
                .First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(PropertyTarget)) != null)
                .Classes.First()
                .Components.Where(x => x is ComponentMapping).First();

            modelVerification(modelInstance);
        }
开发者ID:sbakshi,项目名称:fluent-nhibernate,代码行数:15,代码来源:ComponentConventionTests.cs

示例6: establish_context

        public override void establish_context()
        {
            model = new PersistenceModel();

            var comp_map = new ComponentMap<ComponentTarget>();
            comp_map.Map(x => x.Property);

            model.Add(comp_map);

            var map = new ClassMap<Target>();
            map.Id(x => x.Id);
            map.Component(x => x.Component)
                .ColumnPrefix(column_prefix);
            model.Add(map);
        }
开发者ID:oblivious,项目名称:Oblivious,代码行数:15,代码来源:ComponentColumnPrefixVisitorSpecs.cs

示例7: ShouldApplyToComponents

        public void ShouldApplyToComponents()
        {
            var conventions = new[]
            {
                MockRepository.GenerateMock<IMappingPartConvention>()
            };
            var cm = new ClassMap<PropertyTarget>();
            var component = cm.Component(x => x.Component, c => { });

            conventionFinder.Stub(x => x.Find<IMappingPartConvention>())
                .Return(conventions);

            conventions[0].Stub(x => x.Accept(null))
                .IgnoreArguments()
                .Return(true);

            convention.Apply(cm);

            conventions[0].AssertWasCalled(x => x.Apply(component));
        }
开发者ID:HudsonAkridge,项目名称:fluent-nhibernate,代码行数:20,代码来源:ClassMappingPartDiscoveryConventionTester.cs


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