I have a question about the linq expression:
I do a IQueryable in a class/entity from my EDMX.
On each class I would like convert the potential class associated (Address, Contact) to another class (EntityLight).
When I query my class, I found in the parameters my differents class (Address and Contact).
Each one are MemberAccess when I get these with PropertyOrField and I would like convert/replace each one to an EntityLight and retrieve the data from Address and Contact in tha EntityLight on the same fields: Id, Name.
It's possible? If it's possible how? Thanks a lot
Sample :
public class House
{
public int Id { get; set; }
public Address Address { get; set; }
public Contact Owner { get; set; }
}
public class Address
{
public int Id { get; set; }
public string Name { get; set; }
public string Street { get; set; }
public string City { get; set; }
}
public class Contact
{
public int Id { get; set; }
public string Name { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
public class EntityLight
{
public int Id { get; set; }
public string Name { get; set; }
}