开发者

Adding/Removing MetaColumn from MetaTable

开发者 https://www.devze.com 2023-02-25 17:04 出处:网络
I\'d like to add/remove a column from MetaTable. But table.Column is of type ReadOnlycollection<MetaColumn>.

I'd like to add/remove a column from MetaTable. But table.Column is of type ReadOnlycollection<MetaColumn>.

How can I modify, add or开发者_运维问答 remove a column from the table?

Thank you.


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; }
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号