public void Register(string email, string password) { if (!_emailService.ValidateEmail(email)) { throw new Exception("Invalid email address."); } //other logic _emailService.SendEmail(new MailMessage("*****@*****.**", email) { Subject = "Test from SOLID" }); }