c# - Validate if data contains data from another table before delete -
i need validate parameter if contains values before delete it. parameter in table , values in table. trying using lambda expression, can't find right way. gets data calculationparameters table:
factory.definitions.calculationparameters.list(); // list() lists data.
and gets data calculationparametersvalues table:
factory.definitions.calculationparametersvalues.list(); // list() lists data.
now if "id" (from calculationparameter) equals "calculationparameterid" (from calculationparametersvalue) means calculationparameter contains values , can't delete it.
does have idea me out here ?
i understand want remove calculationparameters have no records in calculationparametersvalues. if so, try :
calculationparameters.removeall(p=> !(calculationparametersvalues.select(c=> c.calculationparameterid)).contains(p.calculationparameterid))
Comments
Post a Comment