Exemplo n.º 1
0
        public static HttpResponseMessage GenerateErrorResponse(this HttpRequestMessage request, string errorIdentifier, params object[] messageParameters)
        {
            HttpResponseMessage response = null;

            WebApiCaller.GetCallerId();
            string message = String.Empty;

            System.Net.HttpStatusCode code;
            ResponseConfiguration.MessageProvider.GetError(errorIdentifier, messageParameters, out code, out message);
            response = request.CreateResponse(code, message);
            return(response);
        }
Exemplo n.º 2
0
        public static HttpResponseMessage GenerateErrorResponse(this HttpRequestMessage request, string errorIdentifier, params object[] messageParameters)
        {
            var principal = Thread.CurrentPrincipal as eXtensibleClaimsPrincipal;

            principal.HasError = true;
            HttpResponseMessage response = null;

            WebApiCaller.GetCallerId();
            string message = String.Empty;

            System.Net.HttpStatusCode code;
            ResponseConfiguration.MessageProvider.GetError(errorIdentifier, messageParameters, out code, out message);
            response = request.CreateResponse(code, message);
            return(response);
        }