Can someone tell me the meaning of the following statement used in C# Code? -


i need know how interpret following,

var diff = orignalconfigfile.where<keyvaluepair<string, list<configurationvalue>>>(x => !newconfig.contains(x) || !x);

here orignalconfigfile, newconfig dictionary. configurationvalue class.

what confused me statement (x => !newconfig.contains(x) || !x) x not containing x newconfig , x itself.

i assume class implicitely convertible bool that's why compiles: || !x.

public static implicit operator bool(configurationvalue me) {    return me.boolproperty; } 

in general not best-practise. should use implicit conversions since difficult understand , prone of errors.

msdn guidelines on conversion operators:

  • do not provide conversion operator if such conversion not expected end users
  • do not provide implicit conversion operator if conversion potentially lossy. example, there should not implicit conversion double int32 because double has wider range int32. explicit conversion operator can provided if conversion potentially lossy.....