How do i replace the hard coded array new int[] {102,7,39} by values from the List called ListOfAuditors in this query ?
public IList<UserDetails> GetAllAssociatesForGivenListOfAuditors(IList<UserDetails> ListOfAuditors)
{
using (OPMSDataSourceDataContext db = new OPMSDataSourceDataContext())
{
var query = (from AuditorAssociatemaps in db.AuditorAssociatemaps
where
(new int[] { 102, 7, 39 }).Contains(AuditorAssociatemaps.AuditorID)
group new { AuditorAssociatemaps.UserData, AuditorAssociatemaps } by new
{
AuditorAssociatemaps.UserData.FirstName,
AuditorAssociatemaps.AssociateID
} into g
orderby
g.Key.FirstName
select new UserDetails
{
FirstName = g.Key.FirstName,
UserID = g.Key.AssociateID
}).ToList();
return query;
}
}