2
votes

I have been renaming our model names in our codebase using resharper. I had made some changes some of the modals names within the .dbml file. I noticed that I need to add the name attribute to the propery in order for the sql to work correctly. I add added this in the code behind view of the .dbml file. I switched back to the designer and made changes were removed? Can I changed the name attribute Manually?

Manually: `[Column(Name="iUnitID", Storage="_UnitID", AutoSync=AutoSync.Always, DbType="Int NOT NULL IDENTITY", IsDbGenerated=true)] public int UnitID

Saved .dbml `[Column(Storage="_UnitID", AutoSync=AutoSync.Always, DbType="Int NOT NULL IDENTITY", IsDbGenerated=true)] public int UnitI

1

1 Answers

4
votes

The .designer.cs file behind your DBML is an autogenerated file; Edit the DBML file directly(I usually edit the XML directly, but you can also use the GUI), when you save it VS will regenerate the .designer.cs file for you.

Inside the DBML file, what you are probably needing to do is change the "Name" attribute of the column you renamed and add a "Member" attribute with the name of the property you want on the class.

eg:

<Column Name="iUnitID" Member="UnitID" .../>