private async Task <List <Symptom> > GetSymptomsByIds(ICollection <Symptom> symptoms) { var symptomsIds = symptoms .Select(x => x.SymptomId) .AsEnumerable(); return(await Symptoms .Where(x => symptomsIds.Contains(x.SymptomId)) .ToListAsync()); }
public async ValueTask <bool> DeleteSymptomsAsync(List <int> symptoms) { var contextSymptoms = Symptoms .Where(x => symptoms.Contains(x.SymptomId)) .AsEnumerable(); Symptoms.RemoveRange(contextSymptoms); await SaveChangesAsync(); return(true); }