// 3.Method Injection
        public void Register(string emailAddress, string password,
                             IEmailService emailService, IOpenAuthService authService)
        {
            IOpenAuthService authResult = authService.RegisterUser(emailAddress, password);

            emailService.SendEmail(emailAddress, authResult.ConfirmationMessage);
        }
Esempio n. 2
0
 public SiteController( IUserService userService, IOpenAuthService openAuthService, IBuildLogService bulidLogService, IHomeContentService homecontentservice )
 {
     this.userService = userService;
     this.openAuthService = openAuthService;
     this.bulidLogService = bulidLogService;
     this.homecontentService = homecontentservice;
 }
 // 1.Constructor Injection
 public UserLogic(IOpenAuthService authService, IEmailService emailService)
 {
     _authService  = authService;
     _emailService = emailService;
 }