Пример #1
0
        private static void ResponseWrite(HttpContext context, LibViewModel content)
        {
            HttpResponse response = context.Response;

            response.ContentType = "text";

            response.Write(JsonHelper.Serialize(content));
            HttpContext.Current.ApplicationInstance.CompleteRequest();
        }
Пример #2
0
        private static void ResponseException(Exception ex, HttpContext context, Func <Exception, string> exToString)
        {
            LibViewModel failure = LibViewModel.CreateFailureJSONResponseViewModel(LibViewModel.GetExceptionCode(ex), exToString(ex));

            ResponseWrite(context, failure);
        }