text: Q:
  
  Order of evaluation, instance and method parameters
  
  Suppose I write the following code:
  int x = 42;
  
  if (x.Equals(x = Foo()))
      Console.WriteLine("ok");
  
  Where Foo is any method returning an integer. Is it guaranteed that the method invocation target (the first x) is evaluated before it is replaced by the return value of Foo()? In other words, is this code guaranteed to print ok if and only if the return value of Foo() is equal to 42?
  I've seen other questions that deal with the order of parameter evaluations, but they don't talk about when the instance (first x) gets evaluated during runtime for non-static methods -- could someone clarify this for me?
  
  A:
  
  This is problem called Sequence Points. This is often represented what happens when you put increment operator inside an expression.
  In case of C# it is strictly defined that expression and method parameters are evaluated from left to right,  from inside out and that any assignment (and side effects in general) is immediately visible for the rest of the expression. 
  You can read more here.
  
  