I have a view model like
public class MemberCommunicationType
{
public long person_id { get; set; }
public int comm_id { get; set; }
public someclass cls{ get; set; }
}
public class GetMemberColl
{
public MemberCommunicationType[] memberCommunication{ get; set; }
}
and I have a query to database like
var query = from p in data.GetMember
where (p.Client == client && p.Person_id == pid)
select p;
this query returns two fields: long person_id, int comm_id which are same in the view model except that the view model has one more field: someclass cls
How can I need add the results returned by the query to my view model?
Output should be a list which contains collection of memberCommunication and a null-valued cls collection for each collection of memberCommunication .
I think you want to do something like this: