/// <summary>Initializes a new instance of the <see cref="InvalidModelStateResult"/> class.</summary>
 /// <param name="exception">The ServiceUnavailable exception information to include in the error.</param>
 /// <param name="includeErrorDetail">
 /// <see langword="true"/> if the error should include exception messages; otherwise, <see langword="false"/>.
 /// </param>
 /// <param name="contentNegotiator">The content negotiator to handle content negotiation.</param>
 /// <param name="request">The request message which led to this result.</param>
 /// <param name="formatters">The formatters to use to negotiate and format the content.</param>
 public ServiceUnavailableExceptionResult(
     ServiceUnavailableException exception,
     bool includeErrorDetail,
     IContentNegotiator contentNegotiator,
     HttpRequestMessage request,
     IEnumerable<MediaTypeFormatter> formatters)
     : this(exception, new DirectDependencyProvider(includeErrorDetail, contentNegotiator, request, formatters))
 {
 }
        private ServiceUnavailableExceptionResult(
            ServiceUnavailableException exception, IDependencyProvider dependencies)
        {
            if (exception == null)
            {
                throw new ArgumentNullException("exception");
            }

            Contract.Assert(dependencies != null);

            _exception = exception;
            _dependencies = dependencies;
        }
 /// <summary>Initializes a new instance of the <see cref="InvalidModelStateResult"/> class.</summary>
 /// <param name="exception">The ServiceUnavailable exception information to include in the error.</param>
 /// <param name="controller">The controller from which to obtain the dependencies needed for execution.</param>
 public ServiceUnavailableExceptionResult(ServiceUnavailableException exception, ApiController controller)
     : this(exception, new ApiControllerDependencyProvider(controller))
 {
 }