本文整理汇总了C#中FluentNHibernate.MappingModel.PropertyMapping.AddColumn方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyMapping.AddColumn方法的具体用法?C# PropertyMapping.AddColumn怎么用?C# PropertyMapping.AddColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FluentNHibernate.MappingModel.PropertyMapping
的用法示例。
在下文中一共展示了PropertyMapping.AddColumn方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldWriteColumns
public void ShouldWriteColumns()
{
var mapping = new PropertyMapping();
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
writer.VerifyXml(mapping)
.Element("column").Exists();
}
示例2: CollectionContainsWithStringShouldBeFalseWhenNoItemsMatching
public void CollectionContainsWithStringShouldBeFalseWhenNoItemsMatching()
{
acceptance
.Expect(x => x.Columns.Contains("boo"));
var mapping = new PropertyMapping();
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
.Matches(new PropertyInspector(mapping))
.ShouldBeFalse();
}
示例3: CollectionIsNotEmptyShouldBeTrueWithItemsWhenUsingExpression
public void CollectionIsNotEmptyShouldBeTrueWithItemsWhenUsingExpression()
{
acceptance
.Expect(x => x.Columns.IsNotEmpty());
var mapping = new PropertyMapping();
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
.Matches(new PropertyInspector(mapping))
.ShouldBeTrue();
}
示例4: CollectionIsEmptyShouldBeFalseWithItemsWhenUsingExpression
public void CollectionIsEmptyShouldBeFalseWithItemsWhenUsingExpression()
{
acceptance
.Expect(x => x.Columns.IsEmpty());
var mapping = new PropertyMapping();
mapping.AddColumn(Layer.Defaults, new ColumnMapping("Column1"));
acceptance
.Matches(new PropertyInspector(mapping))
.ShouldBeFalse();
}
示例5: CollectionContainsWithLambdaShouldBeTrueWhenItemsMatching
public void CollectionContainsWithLambdaShouldBeTrueWhenItemsMatching()
{
acceptance
.Expect(x => x.Columns.Contains(c => c.Name == "Column1"));
var mapping = new PropertyMapping();
mapping.AddColumn(new ColumnMapping { Name = "Column1" });
acceptance
.Matches(new PropertyInspector(mapping))
.ShouldBeTrue();
}
示例6: GetPropertyMapping
private PropertyMapping GetPropertyMapping(Type type, Member property)
{
var mapping = new PropertyMapping
{
ContainingEntityType = type,
Member = property
};
var columnMapping = new ColumnMapping();
columnMapping.Set(x => x.Name, Layer.Defaults, property.Name);
mapping.AddColumn(Layer.Defaults, columnMapping);
mapping.Set(x => x.Name, Layer.Defaults, mapping.Member.Name);
mapping.Set(x => x.Type, Layer.Defaults, GetDefaultType(property));
SetDefaultAccess(property, mapping);
return mapping;
}
示例7: CollectionContainsWithLambdaShouldBeFalseWhenNoItemsMatching
public void CollectionContainsWithLambdaShouldBeFalseWhenNoItemsMatching()
{
acceptance
.Expect(x => x.Columns.Contains(c => c.Name == "boo"));
var mapping = new PropertyMapping();
mapping.AddColumn(Layer.Defaults, new ColumnMapping("Column1"));
acceptance
.Matches(new PropertyInspector(mapping))
.ShouldBeFalse();
}
示例8: CollectionContainsWithStringShouldBeTrueWhenItemsMatching
public void CollectionContainsWithStringShouldBeTrueWhenItemsMatching()
{
acceptance
.Expect(x => x.Columns.Contains("Column1"));
var mapping = new PropertyMapping();
mapping.AddColumn(Layer.Defaults, new ColumnMapping("Column1"));
acceptance
.Matches(new PropertyInspector(mapping))
.ShouldBeTrue();
}
示例9: property_with_column
protected PropertyMapping property_with_column(string column)
{
var property = new PropertyMapping();
property.AddColumn(Layer.Defaults, new ColumnMapping("propertyColumn"));
return property;
}
示例10: ShouldWriteColumns
public void ShouldWriteColumns()
{
var mapping = new PropertyMapping();
mapping.AddColumn(Layer.Defaults, new ColumnMapping("Column1"));
writer.VerifyXml(mapping)
.Element("column").Exists();
}