0

We have an ASP.NET 4.8 project and we thought to introduce Dependency injection principle. A colleague suggested to use OWIN as DI container.

I tried to search for more information regarding ownin, but I don't seem to get the relation between owin and dependency injection.

Can OWIN be used as dependency injection container like some other frameworks: Autofac, Ninject, etc?

  • What DI framework will you use? Typically would any DI-framework have its own middleware. – Eric Herlitz Jan 30 '23 at 09:31
  • 1
    I don't think so. OWIN stands for Open Web Interface for .NET. He might be suggesting to use a DI container like Unity or Ninject to configure OWIN startup. [This might be helpful](https://stackoverflow.com/questions/19781970/how-to-use-di-container-when-owinstartup) – Manik Jan 30 '23 at 10:12
  • thank you Manik for your reply. Actually I proposed Ninject or autofac, but he said no, use owin. I have not used owin, and that put me off the track. He was sure we can use owin as DI container. But I had never come across any tutorials or blocks, etc that used owin as DI container/framework to create loosely coupled components. So, this tells me that he had no idea at all about DI or had never heard about unity, ninject, autofac, etc – user20377051 Jan 30 '23 at 10:28
  • OWIN is not a DI framework, so your colleague misunderstood the concepts. – Lex Li Jan 30 '23 at 17:17

0 Answers0