I'd like to add/remove a column from MetaTable. But table.Column
is of type ReadOnlycollection<MetaColumn>
.
Have you tried ScaffoldColumn?
[MetadataType(typeof(FooMetadata))]
[TableGroupName("Foo")]
public partial class Foo
{
[ScaffoldColumn(true)]
public string MyNewColumnNotinDBTable
{
get
{
return "FooBar";
}
}
}
public class FooMetadata
{
[ScaffoldColumn(false)] // hide Id column
public object Id { get; set; }
public object Name { get; set; }
public object MyNewColumnNotinDBTable { get; set; }
}
精彩评论