开发者

Global rename identity for enity

All identities of entities in model have name "EntityNameId". How I can rename all identi开发者_开发百科ty to "Id"?


Two way I can think of

  1. manually in EF designer
  2. manually editing EDMX XML file by using some regular expression replace

The first one is safe, the second one is tricky because you only have to rename some of them. SSDL should stay as it is and mapping should only rename entity IDs.

If you have something like up to 50 entities, I suggest you rename them in designer manually. It's safe and it shouldn't take too much time (unless you've written a lot of EF code that uses these already).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜