private PropertyInfo CreateProperty(string associationPropertyName, IMessageHandlingMember handler) { var associationProperty = PropertyAccessStrategy.GetProperty(handler.PayloadType, associationPropertyName); if (associationProperty == null) { var handlerName = handler.Unwrap <MethodInfo>().Map(x => x.ToString()).OrElse("unknown"); throw new AxonConfigurationException($"SagaEventHandler {handlerName} defines a property {associationPropertyName} that is not defined on the Event it declares to handle ({handler.PayloadType.Name})"); } return(associationProperty); }
private IProperty <T> CreateProperty <T>(String associationPropertyName, IMessageHandlingMember <T> handler) { IProperty <T> associationProperty = PropertyAccessStrategy.getProperty( handler.PayloadType(), associationPropertyName ); if (associationProperty != null) { return(associationProperty); } string handlerName = handler.Unwrap <MemberInfo>()?.ToString() ?? "unknown"; throw new AseConfigurationException( $"SagaEventHandler {handlerName} defines a property {associationPropertyName} " + $"that is not defined on the Event it declares to handle ({handler.PayloadType().Name})"); }