modelsbuilder/ModelsBuilder.Original

Could existing model deletion be delayed until models are generated successfully?

Opened this issue · 1 comments

Looking at the GenerateModels method in ModelsBuilderBackOfficeController, any *.generated.cs files are deleted before an attempt is made to generate models.

If the models generation then subsequently fails, the solution refuses to build as no models exist.

Would it be possible to delay deletion of existing models, until new models have been successfully generated?

This sounds like a reasonable request, although I think it will result in people not realising an error occurred and use the out of date models...

This could be resolved by generating a warning (e.g. add an Obsolete("This generated model is out of date") attribute for every type or a single #warning).