本文整理汇总了C#中Entity.CreateReferenceTo方法的典型用法代码示例。如果您正苦于以下问题:C# Entity.CreateReferenceTo方法的具体用法?C# Entity.CreateReferenceTo怎么用?C# Entity.CreateReferenceTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entity
的用法示例。
在下文中一共展示了Entity.CreateReferenceTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetUp
public void SetUp()
{
entity1 = new EntityImpl("Entity1");
entity2 = new EntityImpl("Entity2");
entitySet = new EntitySetImpl();
entitySet.AddEntity(entity1);
entitySet.AddEntity(entity2);
entity1.CreateReferenceTo(entity2);
}
示例2: SetUp
public void SetUp()
{
entities = new EntitySetImpl();
entity1 = new EntityImpl("Entity1");
entity1.AddProperty(new PropertyImpl("PrimaryKey") { Type = "System.Int32", IsKeyProperty = true });
entity1.AddProperty(new PropertyImpl("Property") { Type = "bool" });
entity2 = new EntityImpl("Entity2");
entity2.AddProperty(new PropertyImpl("PrimaryKey") { Type = "System.Int32", IsKeyProperty = true });
entities.AddEntity(entity1);
entities.AddEntity(entity2);
reference = entity1.CreateReferenceTo(entity2);
reference.Cardinality1 = Cardinality.One;
reference.Cardinality2 = Cardinality.One;
}
示例3: Setup
public void Setup()
{
mappingSet = new MappingSetImpl(new Database("DB1"), new EntitySetImpl());
entity1 = new EntityImpl("Entity1");
entity2 = new EntityImpl("Entity2");
mappingSet.EntitySet.AddEntity(entity1);
mappingSet.EntitySet.AddEntity(entity2);
reference1 = entity1.CreateReferenceTo(entity2);
var reference2 = entity1.CreateReferenceTo(entity2);
refMapping1 = new TableReferenceMappingImpl { FromTable = new Table("Table2"), ToReference = reference2 };
var refMapping2 = new TableReferenceMappingImpl { FromTable = new Table("Table1"), ToReference = reference1 };
relMapping1 = new RelationshipReferenceMappingImpl { FromRelationship = new RelationshipImpl(), ToReference = reference2 };
var relMapping2 = new RelationshipReferenceMappingImpl { FromRelationship = new RelationshipImpl(), ToReference = reference1 };
mappingSet.AddMapping(refMapping1);
mappingSet.AddMapping(refMapping2);
mappingSet.AddMapping(relMapping1);
mappingSet.AddMapping(relMapping2);
}