Developer Developer - 5 months ago 23
C# Question

IoC lifetime difference

I am a newbie in C #, and just started to learn IoC in web api.
What is the difference in


Sorry for bad English.

  • Singleton

It's mean "one instance for all". All times when you call Resolve (even implicitly) you got the same object

  • Transient

It's opposite to singletone. You'll get as many object as you call Resolve

  • PerWebRequest

Read how Singleton for one request and transient for other (You'll get as many object as request receive)

for more information read the catle.windsor manual or official docs