How to write Conditional boolean query using Nest in c#?

                              .Filter(ff => ff
                                      .Bool(bb => bb
                                          .Must(mm =>
                                         mm.Terms("cityId", 

filterInputs.cities) &&
mm.Terms("fuelTypeId",
filterInputs.fuels) &&
mm.Terms("sellerType",
filterInputs.sellers) &&
mm.Terms("transmissionId",
filterInputs.transmissions) &&
mm.Terms("ownerTypeId",
filterInputs.owners) &&

mm.Terms("usedCarMasterColorsId", filterInputs.colors) &&
mm.Terms("bodyStyleId",
filterInputs.bodytypes) &&
mm.Range(y =>
y.OnField("certificationId").GreaterOrEquals(filterInputs.certifiedCars)) &&
mm.Range(y =>
y.OnField("photoCount").GreaterOrEquals(filterInputs.carsWithPhotos)) &&
mm.Range(y =>
y.OnField("makeYear").GreaterOrEquals(filterInputs.yearMin).LowerOrEquals(filterInputs.yearMax))
&&
mm.Range(r =>
r.OnField("price").GreaterOrEquals(filterInputs.budgetMin).LowerOrEquals(filterInputs.budgetMax))
&&
mm.Range(k =>
k.OnField("kilometers").GreaterOrEquals(filterInputs.kmMin).LowerOrEquals(filterInputs.kmMax))
&&
mm.Terms("makeId",
filterInputs.NewMakes) ||
mm.Terms("rootId",
filterInputs.NewRoots)
)
)
)

I need query if
filterInputs.NewMakes is null then && condition with mm.Terms("rootId",
filterInputs.NewRoots) otherwise it should be || condition.

Thank in advance.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/ce4383f8-7019-4a5d-84c7-85a806ab0723%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.