Can the dbml generated by LINQ to SQL be updated asynchronously?

0

I was making some changes to my database, when I finished as usual the normal is to delete the entities that suffered changes and drag the entities of the database again through the server browser.

What I want to ask you is that if there is any way that this change is done asynchronously, without having to redraw the entities.

Does anyone know how I can achieve it?

    
asked by Myk FLr 24.10.2017 в 22:19
source

2 answers

0

I do not think it is necessary to delete the entities that have changed every time you make a change in the tables in the database.

To update your model, select the model .dbml with right click and select the option " Run Custom Tool ".

Another option is to open the model with a double click and in a blank space press right click and select the option "Validate Model".

This screenshot shows you some of the options you can use:

  

NOTE: The following screenshot belongs to a model with   extension .edmx , but the options to update the model dbml   They should be similar:

    
answered by 24.10.2017 в 22:33
0

There is no way for the changes to be reflected automatically.

LINQ to SQL does not have the stand-alone capability (of moment, same and in the future this is possible) to reflect the changes made in the database in the context of DataModel , therefore, just as you have been doing so far you should remove those entities and replace them in DataModel through the server browser.

Another option is to migrate to Entity Framework , where your project now seems to have a reverse reengineering, you would have to create your classes and the component would be responsible for creating the database structure.

This seems to be a difficult task, however, it depends a lot on what you want to have in your project, the projection you have towards the future and above all realize if this really is a solution since it may be too much effort to automate just a little, in the same way take into account how often your tables change, well, there are so many points to review that this would become an immense response.

In summary, the answer to your question is no , but if you are open to reviewing other options it would be good to ask all your questions so they can be evaluated and find the best solution.

    
answered by 24.10.2017 в 22:49