From 9add7f5ec62e8db4b05880ae83d3d2f4fb40c8e0 Mon Sep 17 00:00:00 2001 From: sultanimbayev Date: Tue, 28 Nov 2017 10:15:55 +0600 Subject: [PATCH] Update sample4.cs (#4859) * Update sample4.cs In OWIN version 4.0 (prerelease) you cannot compare string with Path directly. You must get its value first * Update sample4.cs --- .../getting-started-with-owin-and-katana/samples/sample4.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnet/aspnet/overview/owin-and-katana/getting-started-with-owin-and-katana/samples/sample4.cs b/aspnet/aspnet/overview/owin-and-katana/getting-started-with-owin-and-katana/samples/sample4.cs index 74939f4041..56b983c3da 100644 --- a/aspnet/aspnet/overview/owin-and-katana/getting-started-with-owin-and-katana/samples/sample4.cs +++ b/aspnet/aspnet/overview/owin-and-katana/getting-started-with-owin-and-katana/samples/sample4.cs @@ -6,7 +6,7 @@ public void Configuration(IAppBuilder app) app.Run(context => { // New code: Throw an exception for this URI path. - if (context.Request.Path == "/fail") + if (context.Request.Path.Equals(new PathString("/fail"))) { throw new Exception("Random exception"); } @@ -14,4 +14,4 @@ public void Configuration(IAppBuilder app) context.Response.ContentType = "text/plain"; return context.Response.WriteAsync("Hello, world."); }); -} \ No newline at end of file +}