André Miranda
André Miranda

Reputation: 6588

Find linq Entity through a string value

How can I receive a string value, for example, "User" and find a Entity with this name, and use this Entity as a type?

Thanks!!

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

Upvotes: 0

Views: 117

Answers (1)

John Boker
John Boker

Reputation: 83699

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.

Upvotes: 2

Related Questions