开发者

DBML removes .Name Attributes?

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 na开发者_运维问答me 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


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" .../>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜