[dba-VB] FW: What is generic way to create ADO.NET EF object set?

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Mon Dec 27 03:40:39 CST 2010


Hi All -

That code works:

ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities();
var dataSet = entities.CreateObjectSet<Model.Supplier>();

And I wanted to have something like that:

string enitytName = "NorthwindNETEntities.Supplier"; ...
ObjectContext entities = new Northwind.NET.Model.NorthwindNETEntities();
var dataSet = entities.CreateObjectSet<EntityObject>(entityName);

IOW to supply entity name as a string variable, but the above code currently
returns the following error message:

System.InvalidOperationException : Mapping and metadata information could
not be found for EntityType 'System.Data.Objects.DataClasses.EntityObject'.

Googling didn't give any prompt clues here...

Thank you.

--
Shamil
 




More information about the dba-VB mailing list