List<PersonsInChargeEntity> picList = new List<PersonsInChargeEntity>();
List<ClientEntity> clientList = new List<ClientEntity>();
var returnList = (from PersonsInChargeEntity pic in picList
join ClientEntity client in clientList
on pic.ClientNumber equals client.ClientNumber
select new { ClientNumber = pic.ClientNumber, CompanyName = client.CompanyNameFull, AICGroupID = pic.AICStaffGroupID, RPStaffID = pic.RPStaffID, MPStaffID = pic.MPStaffID, CSPStaffID = pic.CSPStaffID, EQCRStaffID = pic.EQCRStaffID }).ToList<PicList>();
How can i convert my returnList to a List< entity>? below is my class for the entity.
public class PicList
{
int _ClientNumber = 0;
string _CompanyName = "";
int _AICGroupID = 0;
int _RPStaffID = 0;
int _MPStaffID = 0;
int _CSPStaffID = 0;
int _EQCRStaffID = 0;
public PicList()
{
}
public PicList(int ClientNumber, string CompanyName, int AICGroupID, int RPStaffID, int MPStaffID, int CSPStaffID, int EQCRStaffID)
{
_ClientNumber = ClientNumber;
_CompanyName = CompanyName;
_AICGroupID = AICGroupID;
_RPStaffID = RPStaffID;
_MPStaffID = MPStaffID;
_CSPStaffID = CSPStaffID;
_EQCRStaffID = EQCRStaffID;
}
public int ClientNumber
{
get { return _ClientNumber; }
set { _ClientNumber = value; }
}
public string CompanyName
{
get { return _CompanyName; }
set { _CompanyName = value.Trim(); }
}
public int AICGroupID
{
get { return _AICGroupID; }
set { _AICGroupID = value; }
}
public int RPStaffID
{
get { return _RPStaffID; }
set { _RPStaffID = value; }
}
public int MPStaffID
{
get { return _MPStaffID; }
set { _MPStaffID = value; }
}
public int CSPStaffID
{
get { return _CSPStaffID; }
set { _CSPStaffID = value; }
}
public int EQCRStaffID
{
get { return _EQCRStaffID; }
set { _EQCRStaffID = value; }
}
}