0

When I update my Entity model my code generated classes (ie. Model.tt) are rebuild, this is expected. But lets say I want to have this

[DisplayFormat(DataFormatString = "{0:dd MMM yyyy}")]

above some datetime property.

My id is to have a class to inhered the base class via

public class ChildClass : BaseClass
{
    [DisplayFormat(DataFormatString = "{0:dd MMM yyyy}")]
    public override DateTime? Day
    {
        get { return base.Day; }
        set{ base.Day = value; }
    }
}

Maybe there is another way to do this, but can I make the code generated class have all (or some) properties virtual ?

cheers sushiBite

sushiBite
  • 341
  • 2
  • 5
  • 16
  • I'd start with looking at http://stackoverflow.com/questions/1050714/adding-custom-property-attributes-in-entity-framework-code . – mjwills Nov 10 '11 at 11:52

1 Answers1

0

instead of using the override keyword I use the new instead, and thus don't need to have the property virtual

sushiBite
  • 341
  • 2
  • 5
  • 16