public static Exception CreateWebException(HttpStatusCode code, ResourceManagementException ex)
        {
            ExceptionData data = new ExceptionData(ex)
            {
                CorrelationID = ex.CorrelationID
            };

            return(new WebFaultException <ExceptionData>(data, code));
        }
        public static Exception CreateWebException(HttpStatusCode code, Exception ex, string details)
        {
            if (ex != null)
            {
                ExceptionData data = new ExceptionData(ex)
                {
                    Reason = details
                };

                return(new WebFaultException <ExceptionData>(data, code));
            }
            else
            {
                return(new WebFaultException(code));
            }
        }