Beispiel #1
0
 private static void HandleConcurrencyException(HttpListenerContext ctx, ConcurrencyException e)
 {
     ctx.Response.StatusCode = 409;
     ctx.Response.StatusDescription = "Conflict";
     using (var sw = new StreamWriter(ctx.Response.OutputStream))
     {
         new JsonSerializer().Serialize(sw,
                                        new
                                        {
                                        	url = ctx.Request.RawUrl,
                                        	actualETag = e.ActualETag,
                                        	expectedETag = e.ExpectedETag,
                                        	error = e.Message
                                        });
     }
 }
Beispiel #2
0
 private static void HandleConcurrencyException(IHttpContext ctx, ConcurrencyException e)
 {
     ctx.Response.StatusCode = 409;
     ctx.Response.StatusDescription = "Conflict";
     SerializeError(ctx, new
     {
         Url = ctx.Request.RawUrl,
         e.ActualETag,
         e.ExpectedETag,
         Error = e.Message
     });
 }