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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -