Skip to content

Commit

Permalink
Merge pull request #231 from almazik/2.0
Browse files Browse the repository at this point in the history
Fix typo in spelling `Dependency`
  • Loading branch information
pardahlman authored May 26, 2017
2 parents 33a02a3 + 23b9be1 commit e40eea2
Show file tree
Hide file tree
Showing 27 changed files with 159 additions and 159 deletions.
6 changes: 3 additions & 3 deletions src/RawRabbit.Compatibility.Legacy/RawRabbitFactory.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using RawRabbit.Compatibility.Legacy.Configuration;
using RawRabbit.DependecyInjection;
using RawRabbit.DependencyInjection;
using RawRabbit.Enrichers.MessageContext;
using RawRabbit.Enrichers.MessageContext.Context;
using RawRabbit.Instantiation;
Expand All @@ -23,7 +23,7 @@ public static IBusClient<TMessageContext> CreateClient<TMessageContext>(RawRabbi
options.Plugins += builder => builder
.UseMessageContext(context => new MessageContext { GlobalRequestId = Guid.NewGuid() })
.UseContextForwarding();
var simpleIoc = new SimpleDependecyInjection();
var simpleIoc = new SimpleDependencyInjection();
var client = Instantiation.RawRabbitFactory.CreateSingleton(options, simpleIoc, ioc => simpleIoc);
return new BusClient<TMessageContext>(client, simpleIoc.GetService<IConfigurationEvaluator>());
}
Expand All @@ -38,7 +38,7 @@ public static IBusClient CreateClient(RawRabbitOptions options = null)
options.Plugins += builder => builder
.UseMessageContext(context => new MessageContext {GlobalRequestId = Guid.NewGuid()})
.UseContextForwarding();
var simpleIoc = new SimpleDependecyInjection();
var simpleIoc = new SimpleDependencyInjection();
var client = Instantiation.RawRabbitFactory.CreateSingleton(options, simpleIoc, ioc => simpleIoc);
return new BusClient(client, simpleIoc.GetService<IConfigurationEvaluator>());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
using Autofac;
using Autofac.Core;
using Autofac.Core.Registration;
using RawRabbit.DependecyInjection;
using RawRabbit.DependencyInjection;

namespace RawRabbit.DependencyInjection.Autofac
{
public class ComponentContextAdapter : IDependecyResolver
public class ComponentContextAdapter : IDependencyResolver
{
public static ComponentContextAdapter Create(IComponentContext context)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using Autofac;
using RawRabbit.DependecyInjection;
using RawRabbit.DependencyInjection;

namespace RawRabbit.DependencyInjection.Autofac
{
public class ContainerBuilderAdapter : IDependecyRegister
public class ContainerBuilderAdapter : IDependencyRegister
{
private readonly ContainerBuilder _builder;

Expand All @@ -13,7 +13,7 @@ public ContainerBuilderAdapter(ContainerBuilder builder)
_builder = builder;
}

public IDependecyRegister AddTransient<TService, TImplementation>(Func<IDependecyResolver, TImplementation> instanceCreator) where TService : class where TImplementation : class, TService
public IDependencyRegister AddTransient<TService, TImplementation>(Func<IDependencyResolver, TImplementation> instanceCreator) where TService : class where TImplementation : class, TService
{
_builder
.Register<TImplementation>(context => instanceCreator(new ComponentContextAdapter(context.Resolve<IComponentContext>())))
Expand All @@ -22,7 +22,7 @@ public IDependecyRegister AddTransient<TService, TImplementation>(Func<IDependec
return this;
}

public IDependecyRegister AddTransient<TService, TImplementation>() where TService : class where TImplementation : class, TService
public IDependencyRegister AddTransient<TService, TImplementation>() where TService : class where TImplementation : class, TService
{
_builder
.RegisterType<TImplementation>()
Expand All @@ -31,7 +31,7 @@ public IDependecyRegister AddTransient<TService, TImplementation>() where TServi
return this;
}

public IDependecyRegister AddSingleton<TService>(TService instance) where TService : class
public IDependencyRegister AddSingleton<TService>(TService instance) where TService : class
{
_builder
.Register<TService>(context => instance)
Expand All @@ -40,7 +40,7 @@ public IDependecyRegister AddSingleton<TService>(TService instance) where TServi
return this;
}

public IDependecyRegister AddSingleton<TService, TImplementation>(Func<IDependecyResolver, TService> instanceCreator) where TService : class where TImplementation : class, TService
public IDependencyRegister AddSingleton<TService, TImplementation>(Func<IDependencyResolver, TService> instanceCreator) where TService : class where TImplementation : class, TService
{
_builder
.Register<TService>(context => instanceCreator(new ComponentContextAdapter(context.Resolve<IComponentContext>())))
Expand All @@ -49,7 +49,7 @@ public IDependecyRegister AddSingleton<TService, TImplementation>(Func<IDependec
return this;
}

public IDependecyRegister AddSingleton<TService, TImplementation>() where TService : class where TImplementation : class, TService
public IDependencyRegister AddSingleton<TService, TImplementation>() where TService : class where TImplementation : class, TService
{
_builder
.RegisterType<TImplementation>()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Autofac;
using Autofac.Features.ResolveAnything;
using RawRabbit.DependecyInjection;
using RawRabbit.DependencyInjection;
using RawRabbit.Instantiation;

namespace RawRabbit.DependencyInjection.Autofac
Expand Down
4 changes: 2 additions & 2 deletions src/RawRabbit.DependencyInjection.Ninject/NinjectAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
using Ninject;
using Ninject.Activation;
using Ninject.Parameters;
using RawRabbit.DependecyInjection;
using RawRabbit.DependencyInjection;

namespace RawRabbit.DependencyInjection.Ninject
{
public class NinjectAdapter : IDependecyResolver
public class NinjectAdapter : IDependencyResolver
{
private readonly IContext _context;

Expand Down
6 changes: 3 additions & 3 deletions src/RawRabbit.DependencyInjection.Ninject/RawRabbitModule.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Ninject;
using Ninject.Modules;
using RawRabbit.DependecyInjection;
using RawRabbit.DependencyInjection;
using RawRabbit.Instantiation;

namespace RawRabbit.DependencyInjection.Ninject
Expand All @@ -11,7 +11,7 @@ public override void Load()
{
#if NETSTANDARD1_5
KernelConfiguration
.Bind<IDependecyResolver>()
.Bind<IDependencyResolver>()
.ToMethod(context => new NinjectAdapter(context));

KernelConfiguration
Expand All @@ -25,7 +25,7 @@ public override void Load()
#endif
#if NET451
Kernel
.Bind<IDependecyResolver>()
.Bind<IDependencyResolver>()
.ToMethod(context => new NinjectAdapter(context));

Kernel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using System.Threading.Tasks;
using RawRabbit.DependecyInjection;
using RawRabbit.DependencyInjection;

namespace RawRabbit.Operations.StateMachine.Core
{
Expand All @@ -13,9 +13,9 @@ public interface IStateMachineActivator
public class StateMachineActivator : IStateMachineActivator
{
private readonly IModelRepository _modelRepo;
private readonly IDependecyResolver _resolver;
private readonly IDependencyResolver _resolver;

public StateMachineActivator(IModelRepository modelRepo, IDependecyResolver resolver)
public StateMachineActivator(IModelRepository modelRepo, IDependencyResolver resolver)
{
_modelRepo = modelRepo;
_resolver = resolver;
Expand Down
4 changes: 2 additions & 2 deletions src/RawRabbit.vNext/AddRawRabbitExtension.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using RawRabbit.DependecyInjection;
using RawRabbit.vNext.DependecyInjection;
using RawRabbit.DependencyInjection;
using RawRabbit.vNext.DependencyInjection;
using RawRabbitOptions = RawRabbit.vNext.Pipe.RawRabbitOptions;

namespace RawRabbit.vNext
Expand Down
58 changes: 0 additions & 58 deletions src/RawRabbit.vNext/DependecyInjection/ServiceCollectionAdapter.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using RawRabbit.DependencyInjection;

namespace RawRabbit.vNext.DependencyInjection
{
public class ServiceCollectionAdapter : IDependencyRegister
{
public IServiceCollection Collection { get; set; }

public ServiceCollectionAdapter(IServiceCollection collection)
{
Collection = collection;
}

public IDependencyRegister AddTransient<TService, TImplementation>() where TImplementation : class, TService where TService : class
{
Collection.AddTransient<TService, TImplementation>();
return this;
}

public IDependencyRegister AddTransient<TService>(Func<IDependencyResolver, TService> instanceCreator) where TService : class
{
Collection.AddTransient(c => instanceCreator(new ServiceProviderAdapter(c)));
return this;
}

public IDependencyRegister AddTransient<TService, TImplementation>(Func<IDependencyResolver, TImplementation> instanceCreator) where TService : class where TImplementation : class, TService
{
Collection.AddTransient<TService, TImplementation>(c => instanceCreator(new ServiceProviderAdapter(c)));
return this;
}

public IDependencyRegister AddSingleton<TService>(TService instance) where TService : class
{
Collection.AddSingleton(instance);
return this;
}

public IDependencyRegister AddSingleton<TService, TImplementation>(Func<IDependencyResolver, TService> instanceCreator) where TImplementation : class, TService where TService : class
{
Collection.AddSingleton(c => instanceCreator(new ServiceProviderAdapter(c)));
return this;
}

public IDependencyRegister AddSingleton<TService>(Func<IDependencyResolver, TService> instanceCreator) where TService : class
{
Collection.AddSingleton<TService>(c => instanceCreator(new ServiceProviderAdapter(c)));
return this;
}

public IDependencyRegister AddSingleton<TService, TImplementation>() where TImplementation : class, TService where TService : class
{
Collection.AddSingleton<TService, TImplementation>();
return this;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using RawRabbit.DependecyInjection;
using RawRabbit.DependencyInjection;

namespace RawRabbit.vNext.DependecyInjection
namespace RawRabbit.vNext.DependencyInjection
{
public class ServiceProviderAdapter : IDependecyResolver
public class ServiceProviderAdapter : IDependencyResolver
{
private readonly IServiceProvider _provider;

Expand All @@ -15,7 +15,7 @@ public ServiceProviderAdapter(IServiceProvider provider)

public ServiceProviderAdapter(IServiceCollection collection)
{
collection.AddSingleton<IDependecyResolver, ServiceProviderAdapter>(provider => this);
collection.AddSingleton<IDependencyResolver, ServiceProviderAdapter>(provider => this);
_provider = collection.BuildServiceProvider();
}

Expand Down
6 changes: 3 additions & 3 deletions src/RawRabbit.vNext/Pipe/PipeBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using RawRabbit.DependecyInjection;
using RawRabbit.DependencyInjection;
using RawRabbit.Pipe.Middleware;

namespace RawRabbit.vNext.Pipe
{
public class PipeBuilder : RawRabbit.Pipe.PipeBuilder
{
private readonly IDependecyResolver _resolver;
private readonly IDependencyResolver _resolver;

public PipeBuilder(IDependecyResolver resolver) : base(resolver)
public PipeBuilder(IDependencyResolver resolver) : base(resolver)
{
_resolver = resolver;
}
Expand Down
6 changes: 3 additions & 3 deletions src/RawRabbit.vNext/Pipe/RawRabbitFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using RawRabbit.Configuration;
using RawRabbit.DependecyInjection;
using RawRabbit.DependencyInjection;
using RawRabbit.Instantiation;
using RawRabbit.vNext.DependecyInjection;
using RawRabbit.vNext.DependencyInjection;

namespace RawRabbit.vNext.Pipe
{
Expand All @@ -22,7 +22,7 @@ public static InstanceFactory CreateInstanceFactory(RawRabbitOptions options = n
var collection = applicationCollection ?? new ServiceCollection();
var ioc = new ServiceCollectionAdapter(collection);

Action<IDependecyRegister> di = register =>
Action<IDependencyRegister> di = register =>
{
options?.DependencyInjection?.Invoke(collection);
};
Expand Down
33 changes: 0 additions & 33 deletions src/RawRabbit/DependecyInjection/IDependecyRegister.cs

This file was deleted.

Loading

0 comments on commit e40eea2

Please sign in to comment.