Skip to content

Commit

Permalink
simple int works fine
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-wiemer committed Aug 10, 2018
1 parent bdca705 commit 660173b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
7 changes: 2 additions & 5 deletions OwinWebFormSample/Container.cs
@@ -1,10 +1,7 @@
using System;
using System.Threading;

namespace OwinWebFormSample
namespace OwinWebFormSample
{
public static class Container
{
public static AsyncLocal<Guid> AsyncIdentifier { get; set; }
public static int CallId { get; set; }
}
}
2 changes: 1 addition & 1 deletion OwinWebFormSample/Default.aspx.cs
Expand Up @@ -7,7 +7,7 @@ public partial class _Default : Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Container.AsyncIdentifier.Value == Guid.Empty)
if (Container.CallId != 5)
{
throw new Exception("Where is my ID");
}
Expand Down
6 changes: 1 addition & 5 deletions OwinWebFormSample/Startup.cs
@@ -1,8 +1,6 @@
using Microsoft.Owin;
using Owin;
using OwinWebFormSample;
using System;
using System.Threading;

[assembly: OwinStartup(typeof(Startup))]

Expand All @@ -14,9 +12,7 @@ public void Configuration(IAppBuilder app)
{
app.Use((context, next) =>
{
AsyncLocal<Guid> identifier = new AsyncLocal<Guid>();
identifier.Value = Guid.NewGuid();
Container.AsyncIdentifier = identifier;
Container.CallId = 5;
return next.Invoke();
});
Expand Down

0 comments on commit 660173b

Please sign in to comment.