mardi 2 juin 2015

Convert generic object list to non-generic type list

I am trying to convert a List of System.Object objects to a List of strongly typed objects.

Here is the error I am getting:

Object of type 'System.Collections.Generic.List`1[System.Object]' cannot be converted to type 'System.Collections.Generic.List`1[TestApp.Tsc_Mrc_Step]'.

The purpose is because I am writing a business data layer for my project that all you have to do is name your class and properties the same name as entities in your database and the data layer will automatically populate referenced tables as types that are declared in the class.

The business data layer uses reflection, generics and objects to deal with all of this.





Aucun commentaire:

Enregistrer un commentaire