score:1

if you have a cars navigation property in your aspnetuser entity, you could do this:

var query= await _unit.repository<aspnetuser>()
                      .queryable()
                      .where(u=>!u.cars.any(c=>c.id==carid))
                      .select(c => new customermodel()
                                    {
                                        id = c.id,
                                        email = c.email
                                    })
                      .tolistasync();

also you can change your where to .where(u=>u.cars.all(c=>c.id!=carid)),could be more readable


Related Query

More Query from same tag