This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
How can i get all employees by from DB table typeof (Employee) (not by generic argument) ? Now i can write: List<Employee> employeeList = unitOfWork.Query().ToList();
I want have ability to write something like following: List<object> objectList = unitOfWork.Query(typeof (Employee)).ToList(); List<Employee> employeeList = objectList.Cast<Employee>();
It is needed for Dependency injection and Inversion of Control (IoC).
|
|
|
Use the Find method: IList<Entity> entities = unitOfWork.Find(new Query(typeof(Employee))); If for whatever reason you want a concrete list or you want the list type to be List<object> rather than IList<Entity>, you can also use the Find(Query, IList) overload, which returns the results into a list object provided by you. |
|