-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Update container with my needs
- Simplify container by removing interfaces - Added QueueInitialize to Installer binding - Remove IFactory as a creation strategy. It should be added from the application side instead.
- Loading branch information
1 parent
e4b6676
commit c774a00
Showing
92 changed files
with
1,133 additions
and
1,609 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
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
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
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace ManualDi.Main | ||
{ | ||
public static class DiContainerBindingExtensions | ||
{ | ||
public static TypeBinding<TInterface, TInterface> Bind<TInterface>(this DiContainerBindings diContainerBindings) | ||
{ | ||
TypeBinding<TInterface, TInterface> typeBinding = new(); | ||
diContainerBindings.AddBinding(typeBinding); | ||
return typeBinding; | ||
} | ||
|
||
public static TypeBinding<TInterface, TConcrete> Bind<TInterface, TConcrete>(this DiContainerBindings diContainerBindings) | ||
{ | ||
TypeBinding<TInterface, TConcrete> typeBinding = new(); | ||
diContainerBindings.AddBinding(typeBinding); | ||
return typeBinding; | ||
} | ||
|
||
public static TypeBinding<TInterface, TConcrete> Bind<TInterface, TConcrete>(this DiContainerBindings diContainerBindings, TypeBinding<TInterface, TConcrete> typeBinding) | ||
{ | ||
diContainerBindings.AddBinding(typeBinding); | ||
return typeBinding; | ||
} | ||
} | ||
} |
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,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using ManualDi.Main.Scopes; | ||
|
||
namespace ManualDi.Main | ||
{ | ||
public delegate T CreateDelegate<out T>(IDiContainer diContainer); | ||
public delegate void InitializationDelegate<in T>(T instance, IDiContainer container); | ||
public delegate void InjectionDelegate<in T>(T instance, IDiContainer diContainer); | ||
|
||
public interface ITypeBinding | ||
{ | ||
Type InterfaceType { get; } | ||
Type ConcreteType { get; } | ||
ITypeScope TypeScope { get; set; } | ||
bool IsLazy { get; set; } | ||
public Dictionary<object, object>? Metadata { get; set; } | ||
|
||
object Create(IDiContainer container); | ||
public bool NeedsInitialize { get; } | ||
void Initialize(object instance, IDiContainer container); | ||
void Inject(object instance, IDiContainer container); | ||
} | ||
} |
Oops, something went wrong.