public static TState GetState <TState>(this Expression <Action <object[]> > actionSelector) { return((TState)GetStateCore(actionSelector.@Attribute <StateAttribute>().stateObj, typeof(TState))); }