コード例 #1
0
 /// <summary>
 /// Registered instance will live only within liftimescope.
 /// </summary>
 /// <param name="resolvable">The resolvable builder.</param>
 /// <returns>The resolvable builder.</returns>
 public static ItemRegistrationBase PerLifetimeScope(this ItemRegistrationBase resolvable)
 {
     return(resolvable.WithScope(new PerLifetimeScope()));
 }
コード例 #2
0
 /// <summary>
 /// Registered instance will have only one instance per container including nested liftime scopes.
 /// </summary>
 /// <param name="resolvable">The resolvable builder.</param>
 /// <returns>The resolvable builder.</returns>
 public static ItemRegistrationBase SingleInstance(this ItemRegistrationBase resolvable)
 {
     return(resolvable.WithScope(new SingleInstanceScope()));
 }
コード例 #3
0
 /// <summary>
 /// Default. Every instance request will produce new instance.
 /// </summary>
 /// <param name="resolvable">The resolvable builder.</param>
 /// <returns>The resolvable builder.</returns>
 public static ItemRegistrationBase PerDependency(this ItemRegistrationBase resolvable)
 {
     return(resolvable.WithScope(new PerDependencyScope()));
 }