0

Is it possible to change the underlying xml generated for edmx models? I basically want to prevent a specific column from being included in the Storage Model, Conceptual Model and Mappings elements. I can manually remove them and things work as I'd expect but it's not very maintainable when you need to add more Entities and the XML gets regenerated with the stuff you removed previously.

Stephen York
  • 1,247
  • 1
  • 13
  • 42
  • I think the designer will always overwrite the storage model. However you can remove the property (using the designer) from your Conceptual Model just by deleting it. EF Designer will delete the property and the mapping. When you update your model from the database the property should not re-appear. The column will still be there in the Storage Model but since you are not exposing it in the Conceptual Model (and as a result in your Object Model - i.e. classes) this should be OK. – Pawel Nov 17 '12 at 00:55
  • Thanks Pawel for the reply. I have deleted the column from the entity in the designer. But it still is listed in the column mappings page AND it still appears in the generated SQL script. I've run a trace in Sql Profiler and see the deleted column in the INSERT statement's column list and it's passing in NULL. This is enough to cause problems in the trigger on that column, so I need it to be completely excluded from the insert statement. – Stephen York Nov 21 '12 at 00:52

0 Answers0