1

Possible Duplicate:
Configure Property of a static class via spring .net

I want to inject the value for a property inside the static class using spring .net. Code snippet:

Public static Abc
{
Public static IInterface IInterface{get;set;}
}

here i want to inject the IInterface value inside the Abc staic class though spring .net config.

Community
  • 1
  • 1
Reeta
  • 33
  • 2
  • 5

1 Answers1

2

I doubt if you can do it.

Static classes don't really work well with dependency injection.

You will be better off creating the class as a normal class and setting it up as a singleton within the container. I'm pretty sure spring.net will allow this..

Mongus Pong
  • 11,337
  • 9
  • 44
  • 72