0

Entity framework seems to be almost more trouble than it is worth for larger databases.

In my apps (WCF Services, Hosts, and Clients) I need to synchronise various Entity Class Objects, have the Connection parameters in various app.config files (synchronised) and when I do a model update (Database to Code) Explicit Casts made in the models.cs are destroyed. This means a lot of time wasted re-writting code that has already been done.

The more complex this application / Database becomes the more unsuitable EF seems.

How can I keep the Update Wizard undoing all my work, and keep things synchronised automatically?

or should I just go back to Sql Commands?

Dave Gordon
  • 1,815
  • 4
  • 30
  • 52

1 Answers1

1

You should not change generated cs file ever, instead you should create partial classes to add your custom logic into generated classes. Have a look at When is it appropriate to use C# partial classes?, and similarly search google for more about partial classes in C#, you will get better idea of how to use them with your problem.

Community
  • 1
  • 1
Akash Kava
  • 39,066
  • 20
  • 121
  • 167