public Guid?GetRequestId(TInstance instance) { if (instance == null) { throw new ArgumentNullException(nameof(instance)); } return(_requestIdProperty.Get(instance)); }
Task <State <TInstance> > StateAccessor <TInstance> .Get(InstanceContext <TInstance> context) { var stateName = _property.Get(context.Instance); if (string.IsNullOrWhiteSpace(stateName)) { return(Task.FromResult <State <TInstance> >(null)); } return(Task.FromResult(_machine.GetState(stateName))); }
Task <State <TInstance> > StateAccessor <TInstance> .Get(InstanceContext <TInstance> context) { State state = _property.Get(context.Instance); if (state == null) { return(Task.FromResult <State <TInstance> >(null)); } return(Task.FromResult(_machine.GetState(state.Name))); }
public Guid? GetRequestId(TInstance instance) { if (instance == null) throw new ArgumentNullException(nameof(instance)); return _requestIdProperty != null ? _requestIdProperty.Get(instance) : instance.CorrelationId; }
public void Should_be_able_to_access_a_private_setter() { var instance = new PrivateSetter(); PropertyInfo property = instance.GetType() .GetProperties(BindingFlags.Instance | BindingFlags.Public) .Where(x => x.Name == "Name") .First(); var fastProperty = new ReadWriteProperty<PrivateSetter>(property, true); const string expectedValue = "Chris"; fastProperty.Set(instance, expectedValue); Assert.AreEqual(expectedValue, fastProperty.Get(instance)); }
public void Should_be_able_to_access_a_private_setter() { var instance = new PrivateSetter(); var property = instance .GetType() .GetProperties(BindingFlags.Instance | BindingFlags.Public) .First(x => x.Name == "Name"); var fastProperty = new ReadWriteProperty <PrivateSetter>(property); const string expectedValue = "Chris"; fastProperty.Set(instance, expectedValue); Assert.AreEqual(expectedValue, fastProperty.Get(instance)); }
void Execute(Composer composer, TInstance instance) { composer.Execute(() => { CompositeEventStatus value = _property.Get(instance); value.Set(_flag); _property.Set(instance, value); if (!value.Equals(_complete)) { return(composer.ComposeCompleted()); } var taskComposer = new TaskComposer <TInstance>(composer.CancellationToken); _completeCallback(taskComposer, instance); return(taskComposer.Finish()); }); }
Task <State <TInstance> > StateAccessor <TInstance> .Get(InstanceContext <TInstance> context) { var stateIndex = _property.Get(context.Instance); return(Task.FromResult(_index[stateIndex])); }
public CompositeEventStatus Get(TInstance instance) { return(_property.Get(instance)); }
public Guid?GetTokenId(TInstance instance) { return(_tokenIdProperty.Get(instance)); }