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?

Kassem
  • 8,116
  • 17
  • 75
  • 116

1 Answers1

0

You have to specify the property in metadata like you do for other properties.

public class FooMetadata
{
    // other columns in table then your added property
    [Display(Name = "Text")]
    public object EnglishText { get; set; }
}
Ash Machine
  • 9,601
  • 11
  • 45
  • 52