本文整理汇总了C#中MappingSchema.GetEntityDescriptor方法的典型用法代码示例。如果您正苦于以下问题:C# MappingSchema.GetEntityDescriptor方法的具体用法?C# MappingSchema.GetEntityDescriptor怎么用?C# MappingSchema.GetEntityDescriptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MappingSchema
的用法示例。
在下文中一共展示了MappingSchema.GetEntityDescriptor方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddAtribute2
public void AddAtribute2()
{
var ms = new MappingSchema();
var mb = ms.GetFluentMappingBuilder();
mb.HasAttribute<MyClass>(new TableAttribute("NewName") { Configuration = "Test"});
var ed = ms.GetEntityDescriptor(typeof(MyClass));
Assert.That(ed.TableName, Is.EqualTo("MyClass"));
}
示例2: Assosiation
public void Assosiation()
{
var ms = new MappingSchema();
var mb = ms.GetFluentMappingBuilder();
mb.Entity<MyClass>()
.Property(e => e.Parent)
.HasAttribute(new AssociationAttribute { ThisKey = "ID", OtherKey = "ID1" });
var ed = ms.GetEntityDescriptor(typeof(MyClass));
Assert.That(ed.Associations, Is.Not.EqualTo(0));
}
示例3: HasPrimaryKey3
public void HasPrimaryKey3()
{
var ms = new MappingSchema();
var mb = ms.GetFluentMappingBuilder();
mb.Entity<MyClass>().HasPrimaryKey(e => new { e.ID, e.ID1 }, 3);
var ed = ms.GetEntityDescriptor(typeof(MyClass));
Assert.That(ed["ID"]. IsPrimaryKey);
Assert.That(ed["ID"]. PrimaryKeyOrder, Is.EqualTo(3));
Assert.That(ed["ID1"].IsPrimaryKey);
Assert.That(ed["ID1"].PrimaryKeyOrder, Is.EqualTo(4));
}
示例4: TableNameAndSchema
public void TableNameAndSchema()
{
var ms = new MappingSchema();
var mb = ms.GetFluentMappingBuilder();
mb.Entity<MyClass>()
.HasTableName ("Table")
.HasSchemaName("Schema");
var ed = ms.GetEntityDescriptor(typeof(MyClass));
Assert.That(ed.TableName, Is.EqualTo("Table"));
Assert.That(ed.SchemaName, Is.EqualTo("Schema"));
}
示例5: PropertyIncluded
public void PropertyIncluded()
{
var ms = new MappingSchema();
var mb = ms.GetFluentMappingBuilder();
mb.Entity<MyClass2>()
.Property(e => e.ID).IsPrimaryKey()
.Property(e => e.Class3);
var ed = ms.GetEntityDescriptor(typeof(MyClass2));
Assert.That(ed["Class3"], Is.Not.Null);
}
示例6: HasPrimaryKey1
public void HasPrimaryKey1()
{
var ms = new MappingSchema();
var mb = ms.GetFluentMappingBuilder();
mb.Entity<MyClass>().HasPrimaryKey(e => e.ID);
var ed = ms.GetEntityDescriptor(typeof(MyClass));
Assert.That(ed["ID"].IsPrimaryKey);
}