diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-02-22 21:23:50 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-02-22 21:23:50 +0200 |
| commit | 03244940c90d9c0b30d4c4153c241671143456fa (patch) | |
| tree | 8d939312f6eec22b0e5424091492bf1fc80884f0 /Software/Visual_Studio/Tango.Core/DI | |
| parent | c018236c7829a9b9bb5dc064a86761fcaf9b90dd (diff) | |
| download | Tango-03244940c90d9c0b30d4c4153c241671143456fa.tar.gz Tango-03244940c90d9c0b30d4c4153c241671143456fa.zip | |
Implemented FSE machine statuses..
Started working with FSE.BL
Diffstat (limited to 'Software/Visual_Studio/Tango.Core/DI')
| -rw-r--r-- | Software/Visual_Studio/Tango.Core/DI/TangoIOC.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Core/DI/TangoIOC.cs b/Software/Visual_Studio/Tango.Core/DI/TangoIOC.cs index dd3a9f0de..cb27351f8 100644 --- a/Software/Visual_Studio/Tango.Core/DI/TangoIOC.cs +++ b/Software/Visual_Studio/Tango.Core/DI/TangoIOC.cs @@ -186,6 +186,20 @@ namespace Tango.Core.DI } else { + //Try get by inherited.. + registeredType = _registeredTypes.Select(x => x.Value).SingleOrDefault(x => type.IsAssignableFrom(x.InterfaceType)); + + if (registeredType != null) + { + if (registeredType.Instance == null) + { + registeredType.Instance = CreateInstance(registeredType.ImplementationType); + NotifyAwaitingRetrievals(registeredType); + } + + return registeredType.Instance; + } + if (!DesignMode) { throw new InvalidOperationException(String.Format("Requested type '{0}' could not be found.", type.Name)); |
