Link to home
Start Free TrialLog in
Avatar of NickMalloy
NickMalloyFlag for United States of America

asked on

Linq cast a table as a custom class

I created a class that matches a database table that I have in SQL. How can cast my var as this new custom class.

Person C = (from x in ctx1.Persons where x.PersonID == RecID select x).FirstOrDefault();
I want to dump this into a custom class name PersonInfo.
ASKER CERTIFIED SOLUTION
Avatar of Craig Wagner
Craig Wagner
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial