public void Add(EnrollmentRequest request) { var documents = request.Person.Documents.Select(x => x.Type + x.Number); if (_context.Enrollments.Any(x => documents.Contains(x.TypeIdentification + x.Identification))) { throw new EnrollmentAlreadyExistsException(); } _context.Add(_toInfrastructureMapper.Map(request)); _context.SaveChanges(); }