💡 Require Dependency Injection in CSLA 6 #1603
Unanswered
rockfordlhotka
asked this question in
General
Replies: 2 comments 2 replies
-
I keep up with Csla's code using Samples (Project Tracker) for the most part, I am lazy :). |
Beta Was this translation helpful? Give feedback.
1 reply
-
This sounds great on any .NET Core application. As CLSA6 will still support .NET 4.8, will this apply also to .NET 4.8 apps? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For CSLA 6 I am considering requiring that some dependency injection service be enabled/configured in all apps.
(from a thread in the old forum)
Microsoft has included (and used) dependency injection in ASP.NET Core and will continue in .NET 5.
Microsoft has enabled the use of dependency injection for Windows Forms, WPF, console apps, etc. Their templates don't set it up, but it isn't hard to do.
The reason I'm considering requiring it for CSLA 6 is that if I know that I can rely on there being a service provider it becomes much easier (and sometimes just plain possible) to implement some things throughout CSLA.
For example, it would be ideal if you could inject the current logging component into the data portal so you could log events. Today that's possible, but not as easy as in ASP.NET Core, because I don't know for sure that there's a service provider.
There are all sorts of other scenarios where CSLA could do nice/helpful things if only we knew for sure that a service provider was available.
The only negative/breaking impact here, is that any Windows Forms, WPF, console, or other not-ASP.NET style apps would need to add a few lines of code into
Program.cs
or the startup equivalent file. So I don't think the burden is high, and the potential gains are very high.Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions