當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。