0

Is there a way to rename a property in edmx file (other than editing the file manually)?

When the edmx file is completely regenerated, I would like to add some post-generation steps like renaming some properties.

Martin Staufcik
  • 8,295
  • 4
  • 44
  • 63
  • The problem is that you are **deleting** and **creating** the model again. You should not have to do this... only an **update** should be enough. I don't believe there is a way to add post-generation steps – Fabio Sep 18 '15 at 11:39
  • It would help to have this option when the model is not stable yet and resolving missing mapping manually in the designer would need more work than recreating it from DB. – Martin Staufcik Sep 18 '15 at 11:56
  • 1
    If the model is not recognizing the mappings, you probably have some redundant relationships in the database. If you have to manually resolve some mappings, some of your table structures are probably incorrect. – Fabio Sep 18 '15 at 12:03
  • 1
    Furthermore, a model should not have more than 50 entities. You if have more than 50 entities, you should have more than 1 model. If you are working in a large project, consider to use the code-first. Keep in mind that EDMX is a deprecated technology in the next version of EF – Fabio Sep 18 '15 at 12:11
  • Ok, thanks for help. – Martin Staufcik Sep 18 '15 at 12:27
  • Hey, I don't mean to be rude, ok?. I'm not saying that "you are doing it wrong", I'm just saying that EF does not recognize redundant relationships (which I like to do). If you want to use EF you have to follow some of their patterns =/ I also had a lot of problems with EDMX mapping – Fabio Sep 18 '15 at 12:32
  • Fabio, sorry for the short comment, no harm ment. We are using database-first, and when a column or relationship is dropped in DB, it still remains in the designer and needs to be removed there. I'll explore code first more. – Martin Staufcik Sep 18 '15 at 13:00
  • Oh, ok :) You can also use code-first from an existing database (vs will generate the classes). It is too much better than EDMX :) no bugs :) – Fabio Sep 18 '15 at 13:04
  • Ok, thanks for the tip :) – Martin Staufcik Sep 18 '15 at 13:09

0 Answers0