/// <summary>
        /// Get the service for a particular content type.
        /// </summary>
        /// <typeparam name="T">The type of the service.</typeparam>
        /// <param name="serviceProvider">The service provider.</param>
        /// <returns>An instance of the required content, or null if no content is registered.</returns>
        /// <remarks>The type must provide a static/const string called. <c>RegisteredContentType</c> which defines its content type.</remarks>
        public static T GetContent <T>(this IServiceProvider serviceProvider)
            where T : class
        {
            if (serviceProvider == null)
            {
                throw new ArgumentNullException(nameof(serviceProvider));
            }

            string name = ContentFactory.GetContentType(typeof(T));

            return(GetContent <T>(serviceProvider, name));
        }
 /// <inheritdoc/>
 public Task DispatchPayloadToHandlerAsync <TParam1, TParam2>(TPayloadBase payload, string handlerClass, TParam1 param1, TParam2 param2)
 {
     return(this.DispatchAsync(payload, ContentFactory.GetContentType(payload.GetType()), handlerClass, param1, param2));
 }
 /// <inheritdoc/>
 public Task DispatchPayloadToHandlerAsync(TPayloadBase payload, string handlerClass)
 {
     return(this.DispatchAsync(payload, ContentFactory.GetContentType(payload.GetType()), handlerClass));
 }
 /// <inheritdoc/>
 public void DispatchPayloadToHandler <TParam1, TParam2, TParam3>(TPayloadBase payload, string handlerClass, TParam1 param1, TParam2 param2, TParam3 param3)
 {
     this.Dispatch(payload, ContentFactory.GetContentType(payload.GetType()), handlerClass, param1, param2, param3);
 }
 /// <inheritdoc/>
 public void DispatchPayloadToHandler(TPayloadBase payload, string handlerClass)
 {
     this.Dispatch(payload, ContentFactory.GetContentType(payload.GetType()), handlerClass);
 }
 /// <inheritdoc/>
 public Task <TResult> DispatchPayloadToHandlerAsync <TParam1, TParam2, TParam3, TResult>(TPayloadBase payload, string handlerClass, TParam1 param1, TParam2 param2, TParam3 param3)
 {
     return(this.DispatchAsync <TParam1, TParam2, TParam3, TResult>(payload, ContentFactory.GetContentType(payload.GetType()), handlerClass, param1, param2, param3));
 }
 /// <inheritdoc/>
 public TResult DispatchPayloadToHandler <TParam1, TParam2, TResult>(TPayloadBase payload, string handlerClass, TParam1 param1, TParam2 param2)
 {
     return(this.Dispatch <TParam1, TParam2, TResult>(payload, ContentFactory.GetContentType(payload.GetType()), handlerClass, param1, param2));
 }