/// <summary>
        /// Configures the mappings.
        /// </summary>
        /// <param name="configuration">The configuration.</param>
        protected override void ConfigureMappings(ExceptionHttpResponseConfiguration configuration)
        {
            configuration.AddMapping <ServiceErrorApiEvent>(
                (c, e) =>
            {
                if (this.contextResolver.IncludeFullDetails(c.Context))
                {
                    return
                    (new ServiceErrorWithExceptionHttpResponse(
                         c.Formatter.Message("A service error has occurred"),
                         c.Formatter.Code(e.Code),
                         c.Formatter.Message(e.Exception.Message),
                         c.Formatter.Message(e.Exception.ToString())));
                }

                return(new ServiceErrorHttpResponse(
                           c.Formatter.Message("A service error has occurred"),
                           c.Formatter.Code(e.Code)));
            });

            configuration.AddMapping <UnauthenticatedApiEvent>(
                (c, e) =>
                new UnauthenticatedHttpResponse(
                    c.Formatter.Message(e.Message ?? "The user is not authenticated"),
                    c.Formatter.Code(e.Code)));

            configuration.AddMapping <EntityValidationApiEvent>(
                (c, e) =>
                new ResourceValidationHttpResponse(
                    c.Formatter.Code(e.Code),
                    e.ErrorDetails.ToFormatted(c.Formatter)));

            configuration.AddMapping <EntityNotFoundApiEvent>(ToNotFound);

            configuration.AddMapping <EntityNotFoundQueryApiEvent>(
                (c, e) =>
                new ResourceNotFoundQueryHttpResponse(
                    $"The {c.Formatter.Resource(e.EntityType)} resource was not found with the specified parameters",
                    c.Formatter.Code(e.Code),
                    c.Formatter.Resource(e.EntityType),
                    e.Parameters));

            configuration.AddMapping <EntityCreatePermissionApiEvent>(ToCreatePermission);
            configuration.AddMapping <EntityPermissionApiEvent>(ToPermission);
            configuration.AddMapping <EntityCreatedApiEvent>(ToCreate);
        }
 /// <summary>
 /// Configures the mappings.
 /// </summary>
 /// <param name="configuration">The configuration.</param>
 protected abstract void ConfigureMappings(ExceptionHttpResponseConfiguration configuration);