-
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.
Merge pull request #231 from almazik/2.0
Fix typo in spelling `Dependency`
- Loading branch information
Showing
27 changed files
with
159 additions
and
159 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
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
2 changes: 1 addition & 1 deletion
2
src/RawRabbit.DependencyInjection.Autofac/ContainerBuilderExtension.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
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
58 changes: 0 additions & 58 deletions
58
src/RawRabbit.vNext/DependecyInjection/ServiceCollectionAdapter.cs
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
src/RawRabbit.vNext/DependencyInjection/ServiceCollectionAdapter.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 |
---|---|---|
@@ -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; | ||
} | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
Oops, something went wrong.