-
-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: The simple injector DI container isn't practical #240
Comments
Again thanks for taking the time for letting us know about the issue @chuuddo |
doesn't seem to cater for contracts. |
There was a way to do named instances in Simple Injector. I can't remember how off the top. The library considers the concern a bad practice, but it still allows you to do it. I'll see if I can pull an example. But your right it isn't idea. |
Worse case scenario we just do a intermeditory generic collection with a
dict. Eg ContractContainer<T> with extension methods for the simple
injector side.
…On Sat., 3 Aug. 2019, 8:23 pm Rodney Littles II, ***@***.***> wrote:
There was a way to do named instances in Simple Injector. I can't remember
how off the top. The library considers the concern a bad practice, but it
still allows you to do it. I'll see if I can pull an example. But your
right it isn't idea.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#240?email_source=notifications&email_token=ABMQMMIM2YSS7QZHRTIAIALQCVMAXA5CNFSM4GRSDJG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3PL3XI#issuecomment-517914077>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABMQMMLPNKFVXUNFU5NKDDDQCVMAXANCNFSM4GRSDJGQ>
.
|
Since using ReactiveUI + Splat, I find myself using the follwing (recommended) pattern over and over again:
This bugs me because it's because of error-prone code duplication and the fact that this Splat pattern "bleeds" into every class using DI. It reminds me so much of MEF's Using Splat.SimpleInjector makes Sextant unusable because
I wonder, is this just an issue with Sextant (should I open an issue?) or can the register-resolve-register pattern also be found in other ReactiveUI components? Also, I find it hard to understand how
I tried looking into |
As originally reported by @chuuddo, they have provided unit tests to help produce the exception here:
master...chuuddo:rxui_initialization_breaks_simpleinjector_resolver
Details of their explanation:
SimpleInjectorDependencyResolver not works in real apps.
I made a pull request #239 with changes to View and ViewModel classes to start initialization of RxApp and all tests fails.
After some investigations i found this issues:
splat/src/Splat.SimpleInjector/SimpleInjectorDependencyResolver.cs
Line 38 in d27b0b4
I don't have any workarounds for second issue. Can we use this DI container with ReactiveUI?
Originally posted by @chuuddo in #233 (comment)
The text was updated successfully, but these errors were encountered: