Any examples of setting up csla for DI in Asp.net on .net framework? #1824
-
In the example I see how Csla is configured to use DI in the data portal methods, but these are using Asp.net Core, and I'm still on .net framework. Any examples of setting up Csla for DI on .net framework? Ideally using Unity for the container 😄 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I am pretty sure the WfpUI project in the ProjectTracker solution currently demonstrates how to initialize DI during startup. It is a little tricky, from what I've found, to set up DI in WinForms and WPF - at least for .NET Framework projects - but it can be done. There are lots of examples of console app setup, and of course ASP.NET setup out there in the wild. I haven't ever looked at how to swap out the default DI engine provided by .NET for something like Unity or Autofac. I have read articles that indicate these things are possible (at least with Autofac), because there's a type of plug-in model behind the Microsoft DI framework. |
Beta Was this translation helpful? Give feedback.
-
In case anyone else needs this, I think its as simple as:
I needed to add Microsoft.Extensions.DependencyInjection and Unity.Microsoft.DependencyInjection nuget packages. Once I did that, dependencies were being correctly injected into the data portal methods. |
Beta Was this translation helpful? Give feedback.
In case anyone else needs this, I think its as simple as:
I needed to add Microsoft.Extensions.DependencyInjection and Unity.Microsoft.DependencyInjection nuget packages. Once I did that, dependencies were being correctly injected into the data portal methods.