Best way to update LINQ to SQL classes after database schema change

前端 未结 7 2064
别那么骄傲
别那么骄傲 2020-11-29 16:08

I\'m using LINQ to SQL classes in a project where the database design is still in a bit of flux.

Is there an easy way of synchronising the classes with the schema, o

7条回答
  •  不知归路
    2020-11-29 16:30

    How about modifying the Properties of the entity/table within the DataContext design surface within Visual Studio?

    For instance if I added a column to an SQL Server table:

    1. Open the *.dbml file.
    2. Right click the entity and select Add > Property.
    3. Fill out the values in the Properties window for the new column.
    4. Build your solution.

    The auto generated model classes should reflect the new column that was added.

提交回复
热议问题