public void SetStorage(object provider, object storeValue, System.Reflection.PropertyInfo pi, ResourceOperationContext context) { StateStore state = (StateStore)storeValue; var obj = pi.GetValue(provider); state.Restore(obj); }