0

I have a case where I need to add properties to my generated model. Basically what I've done is the following:

  • Generate the entity model from an existing database
  • Created a partial class which has the same name and namespace as one of my entity models
  • I added a property inside the partial class and decorated it with [ScaffoldColumn(true)]:

    [ScaffoldColumn(true)]
    public String EnglishText
    {
        get
        {
            return this._resourceHelper.GetValue(this.Code, 4, 1);
        }
        set
        {
            this._resourceHelper.SetValue(value, this.Code, 4, 1);
        }
    }
    

But for some reason, this property is not being rendered on the view. Do I need to do anything else in order to tell DD to render the property?

4

1 に答える 1

0

他のプロパティの場合と同様に、メタデータでプロパティを指定する必要があります。

public class FooMetadata
{
    // other columns in table then your added property
    [Display(Name = "Text")]
    public object EnglishText { get; set; }
}
于 2012-11-09T18:23:05.543 に答える