-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Spaces to tabs * Removed unused 'using' statements
- Loading branch information
par.dahlman
committed
Mar 16, 2016
1 parent
48a1e05
commit b8163fb
Showing
3 changed files
with
182 additions
and
189 deletions.
There are no files selected for viewing
95 changes: 45 additions & 50 deletions
95
src/RawRabbit.DependencyInjection.Ninject/KernelExtension.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 | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,52 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using Ninject; | ||
using Ninject; | ||
using RawRabbit.Common; | ||
using RawRabbit.Configuration; | ||
using RawRabbit.Context; | ||
|
||
namespace RawRabbit.DependencyInjection.Ninject | ||
{ | ||
public static class KernelExtension | ||
{ | ||
public static IKernel RegisterRawRabbit<TMessageContext>(this IKernel kernel) | ||
where TMessageContext : IMessageContext | ||
{ | ||
kernel.Load(new RawRabbitModule<TMessageContext>()); | ||
return kernel; | ||
} | ||
|
||
public static IKernel RegisterRawRabbit(this IKernel kernel) | ||
{ | ||
kernel.Load(new RawRabbitModule()); | ||
return kernel; | ||
} | ||
|
||
public static IKernel RegisterRawRabbit<TMessageContext>(this IKernel kernel, RawRabbitConfiguration configuration) | ||
where TMessageContext : IMessageContext | ||
{ | ||
kernel | ||
.Bind<RawRabbitConfiguration>() | ||
.ToConstant(configuration) | ||
.InSingletonScope(); | ||
|
||
kernel.Load(new RawRabbitModule<TMessageContext>()); | ||
return kernel; | ||
} | ||
|
||
public static IKernel RegisterRawRabbit(this IKernel kernel, RawRabbitConfiguration configuration) | ||
{ | ||
return RegisterRawRabbit<MessageContext>(kernel, configuration); | ||
} | ||
|
||
public static IKernel RegisterRawRabbit<TMessageContext>(this IKernel kernel, string connectionString) | ||
where TMessageContext : IMessageContext | ||
{ | ||
var config = ConnectionStringParser.Parse(connectionString); | ||
return RegisterRawRabbit<TMessageContext>(kernel, config); | ||
} | ||
|
||
public static IKernel RegisterRawRabbit(this IKernel kernel, string connectionString) | ||
{ | ||
return RegisterRawRabbit<MessageContext>(kernel, connectionString); | ||
} | ||
|
||
} | ||
public static class KernelExtension | ||
{ | ||
public static IKernel RegisterRawRabbit<TMessageContext>(this IKernel kernel) | ||
where TMessageContext : IMessageContext | ||
{ | ||
kernel.Load(new RawRabbitModule<TMessageContext>()); | ||
return kernel; | ||
} | ||
|
||
public static IKernel RegisterRawRabbit(this IKernel kernel) | ||
{ | ||
kernel.Load(new RawRabbitModule()); | ||
return kernel; | ||
} | ||
|
||
public static IKernel RegisterRawRabbit<TMessageContext>(this IKernel kernel, RawRabbitConfiguration configuration) | ||
where TMessageContext : IMessageContext | ||
{ | ||
kernel | ||
.Bind<RawRabbitConfiguration>() | ||
.ToConstant(configuration) | ||
.InSingletonScope(); | ||
|
||
kernel.Load(new RawRabbitModule<TMessageContext>()); | ||
return kernel; | ||
} | ||
|
||
public static IKernel RegisterRawRabbit(this IKernel kernel, RawRabbitConfiguration configuration) | ||
{ | ||
return RegisterRawRabbit<MessageContext>(kernel, configuration); | ||
} | ||
|
||
public static IKernel RegisterRawRabbit<TMessageContext>(this IKernel kernel, string connectionString) | ||
where TMessageContext : IMessageContext | ||
{ | ||
var config = ConnectionStringParser.Parse(connectionString); | ||
return RegisterRawRabbit<TMessageContext>(kernel, config); | ||
} | ||
|
||
public static IKernel RegisterRawRabbit(this IKernel kernel, string connectionString) | ||
{ | ||
return RegisterRawRabbit<MessageContext>(kernel, connectionString); | ||
} | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
src/RawRabbit.DependencyInjection.Ninject/Properties/AssemblyInfo.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
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