本文整理匯總了C#中ClassMap.Join方法的典型用法代碼示例。如果您正苦於以下問題:C# ClassMap.Join方法的具體用法?C# ClassMap.Join怎麽用?C# ClassMap.Join使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ClassMap
的用法示例。
在下文中一共展示了ClassMap.Join方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ShouldSetForeignKeyOnJoin
public void ShouldSetForeignKeyOnJoin()
{
var classMap = new ClassMap<ExampleInheritedClass>();
classMap.Join("two", m => {});
model.Add(classMap);
model.BuildMappings()
.First()
.Classes.First()
.Joins.First()
.Key.Columns.First().Name.ShouldEqual("ExampleInheritedClass!");
}
示例2: ShouldntDuplicateJoinMapping
public void ShouldntDuplicateJoinMapping()
{
var model = new PersistenceModel();
var classMap = new ClassMap<Target>();
classMap.Id(x => x.Id);
classMap.Join("other", m => m.Map(x => x.Property));
model.Add(classMap);
model.Configure(cfg);
cfg.ClassMappings.First()
.JoinClosureIterator.Count().ShouldEqual(1);
}
示例3: VerifyModel
private void VerifyModel(Action<JoinMapping> modelVerification)
{
var classMap = new ClassMap<ExampleClass>();
classMap.Id(x => x.Id);
classMap.Join("table", m => {});
model.Add(classMap);
var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.Classes.First()
.Joins.First();
modelVerification(modelInstance);
}
示例4: Mapping
private void Mapping(Action<JoinPart<ExampleClass>> mappingDefinition)
{
var classMap = new ClassMap<ExampleClass>();
classMap.Id(x => x.Id);
classMap.Join("table", mappingDefinition);
mapping = classMap;
mappingType = typeof(ExampleClass);
}