开发者

Find linq Entity through a string value

开发者 https://www.devze.com 2022-12-10 03:53 出处:网络
How can I receive a string value, for example, \"User\" and find a Entity wit开发者_Go百科h this name, and use this Entity as a type?

How can I receive a string value, for example, "User" and find a Entity wit开发者_Go百科h this name, and use this Entity as a type?

Thanks!!

EDITED: "User" is the name of the Entity in dbml, not a property


you could possibly use the Mapping.GetTables() on your datacontext, ie:

var tables = context.Mapping.GetTables().ToList();

then search through that to find the name.

0

精彩评论

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