2

Some friends and I are making a system based on C#, they make the Desktop application with CodeFirst and I make the Web application from their CodeFirst, but with DataBaseFirst, add DataBase.

It turns out that when I am going to add the model, I select the tables and start generating them, but it takes at least two hours.

I need your help because it takes a lot of time and I can not find a solution online.

Camilo Terevinto
  • 31,141
  • 6
  • 88
  • 120
HenryGuillen17
  • 370
  • 1
  • 3
  • 13
  • 1
    This is Entity Framework, not ADO.NET, that you are using. – Camilo Terevinto Jan 22 '18 at 19:26
  • about what thing u want help buddy ? it is the site to share the problems not the sit for asking opinions ! here what u can do is post ur code with any bug we will solve that out ! – Syed Muhammad Munis Ali Jan 22 '18 at 19:29
  • 1
    I'm adding an ADO.NET Entity Data Model element, and that's exactly why I mean it, not the Entity Framework in general. I'm not asking for opinions, I'm presenting a real problem that nowhere have I been able to get the solution. When I create the ADO.Net object it takes too long and I do not know why it will be or what I can do, that's why I'm asking for help to see if anyone knows about the subject and can give me a solution. – HenryGuillen17 Jan 22 '18 at 19:32
  • The `.edmx` file is indeed named "ADO .NET Entity Data Model" in certain versions of Visual Studio. – Omar Himada Jan 22 '18 at 19:35
  • So how do I get someone to help me? I ask for help here of something that is happening to me when generating the model of my database, and I do not understand why they do not want to help me. It is a real problem that is happening to me. I have other projects and they do not last in generating so much time, it only takes a few seconds. I would like to know what the possible cause of it is. – HenryGuillen17 Jan 22 '18 at 19:35
  • When you open SQL Server Management Studio and go to the database, how long does it take to do a `SELECT` on one of the tables? If its very long it could be network related. – Omar Himada Jan 22 '18 at 19:36
  • Well, it really is fast, even the tables do not have a lot of data, but to perform any SELECT it is very fast - normal. It's just that I have other projects that way, but it only takes a few seconds to generate the DataBaseFirst model – HenryGuillen17 Jan 22 '18 at 19:39
  • Did you check the tt template file, did you tried to change it? Some message on output window shows the operation that is taking such time? – Diego Rafael Souza Jan 22 '18 at 19:46
  • @DiegoRafaelSouza In the "Entity Data Model" output only output: Generated model file: ModelService.edmx The loading of the metadata from the Database took 00:00:00.7478236 Generation of the model took 02:13:49.9475509 --- I'm not sure of the tt template file, but it modifies everything – HenryGuillen17 Jan 22 '18 at 19:56
  • [Take a look here](https://stackoverflow.com/questions/30053661/entity-data-model-wizard-too-slow-sql-database). It seems the same problem you describe. – Diego Rafael Souza Jan 22 '18 at 20:09
  • That solution seems very good. I will try and inform you. Thank you very much – HenryGuillen17 Jan 22 '18 at 20:17
  • @DiegoRafaelSouza If the problem was solved, I really thank you very much for being one of the only ones who was willing to help me, because others did not want to. How do I publish the answer and place it as a winner? – HenryGuillen17 Jan 22 '18 at 20:24
  • I've posted it as an answer referring the original thread. I'm glad to help. Please notice that the main community goal is to keep the forum clear and easy to find the solutions. I'm sure the guys had no intention to critic you, but they do want keep the community health =) – Diego Rafael Souza Jan 22 '18 at 20:42

1 Answers1

1

As discussed in this question, it seems to be a bug in reverse engineering using SQL Server.

This issue was fixed by a cumulative update or a service pack, depending on the version you are running on.

The update is available here

Diego Rafael Souza
  • 5,241
  • 3
  • 23
  • 62