Is this possible to rewrite this with linq?
C#:
var collection = await db.Clients.Where(element
=> element.ClientTypeId == 1 ||
element.ClientTypeId == 4 ||
element.ClientTypeId == 5 && idsOfClients.Contains(element.ClientId)).ToListAsync();
var baseCollection = new List<BaseClientTypeBusinessModel>();
foreach (var item in collection)
{
if (item.ClientTypeId == 1)
{
var model = _mapper.Map<ClientJuridicalBusinessModel>(item);
baseCollection.Add(model);
}
else if (item.ClientTypeId == 4)
{
var model = _mapper.Map<ClientPhysicalBusinessModel>(item);
baseCollection.Add(model);
}
else if (item.ClientTypeId == 5)
{
var model = _mapper.Map<ClientIndividualEntrepreneurBusinessModel>(item);
baseCollection.Add(model);
}
}