本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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