Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. @RequestScoped
  2. public class RequestBean {
  3. }
  4.  
  5. @ApplicationScoped
  6. public class ApplicationBean {
  7. }
  8.  
  9. services.AddScoped<ICharacterRepository, CharacterRepository>();
  10. services.AddTransient<IOperationTransient, Operation>();
  11. services.AddScoped<IOperationScoped, Operation>();
  12. services.AddSingleton<IOperationSingleton, Operation>();
  13. services.AddSingleton<IOperationSingletonInstance>(new Operation(Guid.Empty));
  14. services.AddTransient<OperationService, OperationService>();
  15.  
  16. [RequestScoped]
  17. public class RequestBean {
  18. }
  19.  
  20. [ApplicationScoped]
  21. public class ApplicationBean {
  22. }
  23.  
  24. To use:
  25.  
  26. [Inject] // Similar to CDI @Inject
  27. private RequestBean requestBean;
  28.  
  29. And more ....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement