modelsbuilder / ModelsBuilder.Original

The Community Models Builder for Umbraco
MIT License
114 stars 49 forks source link

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

Open tompipe opened 5 years ago

tompipe commented 5 years ago

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?

ronaldbarendse commented 5 years ago

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).