efcore icon indicating copy to clipboard operation
efcore copied to clipboard

RevEng: add a way to handle shadow properties when generating a entity code file

Open maumar opened this issue 3 years ago • 1 comments

Currently, when we generate c# code for entities during scaffolding, we add code for all properties in the class. This is a problem for temporal tables, since the period properties MUST be shadow (validation fails otherwise). We should have a way to mark a property so that it won't get the code generated for it. (alternatively, extensibility to generate code classes in a provider specific way)

maumar avatar Sep 13 '21 22:09 maumar

Should we mark property shadow in scaffolding in any case? How would we determine the heuristic when a user want a property to be skipped from CLR model? Wouldn't it better to scaffold everything and let user skip some properties through templates? For this particular issue, if we lift the restriction that temporal properties don't have to be shadow, we wouldn't really need this. (again it raises the question from user perspective we they want those properties in code model or not)

smitpatel avatar Sep 15 '22 01:09 smitpatel