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

1

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.