I have two lists IEnumerables
which I must compare to make the ids of the lists are projected on a grid, the ids
are team professionals and the comparison is for when two professionals are selected, the list return the equipment where only they are EJ:
public async Task<MiniEquipoModel> GetMiniEquipoGrillaAsync(SearchFilter filter,
CancellationToken cancellationToken = default(CancellationToken))
{
//Buscar profesionales que coincidan en miniequipos
var MiniEquipo = await _miniEquipoCommonRepository.GetMiniEquipoByProfesionalAsync(filter, cancellationToken).ConfigureAwait(false);
var result = new MiniEquipoModel();
var grupoMiniEquipo = new List<MiniEquipoCommonModel>();
foreach (var item in MiniEquipo.ListaMiniEquipo)
{
if (ValidarProfesionalesMinimos(item.Ids, filter.PersonaIds))
grupoMiniEquipo.Add(item);
}
result.ListaMiniEquipo = grupoMiniEquipo;
result.Total = MiniEquipo.Total;
return result;
}
#region Métodos privados
private bool ValidarProfesionalesMinimos(IEnumerable<int> ids, IEnumerable<int> personaIds)
{
var profesionalIds = _miniEquipoRepository.GetProfesional(ids);
var result = profesionalIds.SequenceEqual(personaIds);
return result;
}
#endregion
in the private method as I do so that I return the comparison in "true" (until now it returns false and that makes that in the part above in the IF I do not add the item in GrupoMiniEquipo), I need that I return true in the comparison in the private method. but I do not know how to do it right