Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
182 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
[submodule "katana"] | |||
path = katana | |||
url = https://git01.codeplex.com/katanaproject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,6 +1,4 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||
<packages> | <packages> | ||
<package id="Microsoft.AspNet.Owin" version="0.7" targetFramework="net40" /> | <package id="Owin" version="0.5" targetFramework="net40" /> | ||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" /> | |||
<package id="Owin.Startup" version="0.4" targetFramework="net40" /> | |||
</packages> | </packages> |
61 changes: 61 additions & 0 deletions
61
....AspNet.SignalR.Server/App_Packages/Owin.Extensions.Sources.0.5/StartupExtensions.Func.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,61 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Threading.Tasks; | |||
|
|||
namespace Owin | |||
{ | |||
using AppFunc = Func<IDictionary<string, object>, Task>; | |||
|
|||
internal static partial class StartupExtensions | |||
{ | |||
public static IAppBuilder UseFunc<TApp>(this IAppBuilder builder, Func<TApp, TApp> middleware) | |||
{ | |||
return builder.Use(middleware); | |||
} | |||
|
|||
public static IAppBuilder UseFunc(this IAppBuilder builder, Func<AppFunc, AppFunc> middleware) | |||
{ | |||
return builder.Use(middleware); | |||
} | |||
|
|||
public static IAppBuilder UseFunc<T1>(this IAppBuilder builder, Func<AppFunc, T1, AppFunc> middleware, T1 arg1) | |||
{ | |||
return builder.UseFunc<AppFunc>(app => middleware(app, arg1)); | |||
} | |||
|
|||
public static IAppBuilder UseFunc<T1, T2>(this IAppBuilder builder, Func<AppFunc, T1, T2, AppFunc> middleware, T1 arg1, T2 arg2) | |||
{ | |||
return builder.UseFunc<AppFunc>(app => middleware(app, arg1, arg2)); | |||
} | |||
|
|||
public static IAppBuilder UseFunc<T1, T2, T3>(this IAppBuilder builder, Func<AppFunc, T1, T2, T3, AppFunc> middleware, T1 arg1, T2 arg2, T3 arg3) | |||
{ | |||
return builder.UseFunc<AppFunc>(app => middleware(app, arg1, arg2, arg3)); | |||
} | |||
|
|||
public static IAppBuilder UseFunc<T1, T2, T3, T4>(this IAppBuilder builder, Func<AppFunc, T1, T2, T3, T4, AppFunc> middleware, T1 arg1, T2 arg2, T3 arg3, T4 arg4) | |||
{ | |||
return builder.UseFunc<AppFunc>(app => middleware(app, arg1, arg2, arg3, arg4)); | |||
} | |||
|
|||
public static IAppBuilder UseFunc<T1>(this IAppBuilder builder, Func<T1, Func<AppFunc, AppFunc>> middleware, T1 arg1) | |||
{ | |||
return builder.UseFunc<AppFunc>(app => middleware(arg1)(app)); | |||
} | |||
|
|||
public static IAppBuilder UseFunc<T1, T2>(this IAppBuilder builder, Func<T1, T2, Func<AppFunc, AppFunc>> middleware, T1 arg1, T2 arg2) | |||
{ | |||
return builder.UseFunc<AppFunc>(app => middleware(arg1, arg2)(app)); | |||
} | |||
|
|||
public static IAppBuilder UseFunc<T1, T2, T3>(this IAppBuilder builder, Func<T1, T2, T3, Func<AppFunc, AppFunc>> middleware, T1 arg1, T2 arg2, T3 arg3) | |||
{ | |||
return builder.UseFunc<AppFunc>(app => middleware(arg1, arg2, arg3)(app)); | |||
} | |||
|
|||
public static IAppBuilder UseFunc<T1, T2, T3, T4>(this IAppBuilder builder, Func<T1, T2, T3, T4, Func<AppFunc, AppFunc>> middleware, T1 arg1, T2 arg2, T3 arg3, T4 arg4) | |||
{ | |||
return builder.UseFunc<AppFunc>(app => middleware(arg1, arg2, arg3, arg4)(app)); | |||
} | |||
} | |||
} |
21 changes: 21 additions & 0 deletions
21
....AspNet.SignalR.Server/App_Packages/Owin.Extensions.Sources.0.5/StartupExtensions.Type.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,21 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Threading.Tasks; | |||
|
|||
namespace Owin | |||
{ | |||
using AppFunc = Func<IDictionary<string, object>, Task>; | |||
|
|||
internal static partial class StartupExtensions | |||
{ | |||
public static IAppBuilder UseType<TMiddleware>(this IAppBuilder builder, params object[] args) | |||
{ | |||
return builder.Use(typeof(TMiddleware), args); | |||
} | |||
|
|||
public static IAppBuilder UseType(this IAppBuilder builder, Type type, params object[] args) | |||
{ | |||
return builder.Use(type, args); | |||
} | |||
} | |||
} |
58 changes: 58 additions & 0 deletions
58
...osoft.AspNet.SignalR.Server/App_Packages/Owin.Extensions.Sources.0.5/StartupExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,58 @@ | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Threading.Tasks; | |||
|
|||
namespace Owin | |||
{ | |||
using AppFunc = Func<IDictionary<string, object>, Task>; | |||
|
|||
internal static partial class StartupExtensions | |||
{ | |||
public static void Run(this IAppBuilder builder, object app) | |||
{ | |||
builder.Use(new Func<object, object>(ignored => app)); | |||
} | |||
|
|||
public static AppFunc Build(this IAppBuilder builder) | |||
{ | |||
return builder.Build<AppFunc>(); | |||
} | |||
|
|||
public static TApp Build<TApp>(this IAppBuilder builder) | |||
{ | |||
return (TApp)builder.Build(typeof(TApp)); | |||
} | |||
|
|||
public static AppFunc BuildNew( | |||
this IAppBuilder builder, | |||
Action<IAppBuilder> configuration) | |||
{ | |||
return builder.BuildNew<AppFunc>(configuration); | |||
} | |||
|
|||
public static TApp BuildNew<TApp>( | |||
this IAppBuilder builder, | |||
Action<IAppBuilder> configuration) | |||
{ | |||
var nested = builder.New(); | |||
configuration(nested); | |||
return nested.Build<TApp>(); | |||
} | |||
|
|||
public static void AddSignatureConversion( | |||
this IAppBuilder builder, | |||
Delegate conversion) | |||
{ | |||
object value; | |||
if (builder.Properties.TryGetValue("builder.AddSignatureConversion", out value) && | |||
value is Action<Delegate>) | |||
{ | |||
((Action<Delegate>)value).Invoke(conversion); | |||
} | |||
else | |||
{ | |||
throw new InvalidOperationException("IAppBuilder does not contain builder.AddSignatureConversion method"); | |||
} | |||
} | |||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,5 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||
<packages> | <packages> | ||
<package id="Owin.Startup" version="0.4" targetFramework="net40" /> | <package id="Owin" version="0.5" targetFramework="net40" /> | ||
<package id="Owin.Extensions.Sources" version="0.5" targetFramework="net40" /> | |||
</packages> | </packages> |