예제 #1
0
        // the interface is used here as a jumpboard for kicking off the extension method (it works as a methodful role) instead of the traditional use of interfaces
        public static void Submit(this SubmitModel self, EmailSender sender)
        {
            // The implementation of the use case by using the "primitive methods" of the domain objects

            // validate email address in contactform data

            // send an email to my gmail address with all contactform data
            sender.SendMail(self.EmailAddress, "*****@*****.**", self.Subject, self.Body);

            // display in the form View a disabled subject field when the call to this form is initiated by a CV request
        }
예제 #2
0
 public ContactFormSubmitContext(SubmitModel data, EmailSender mailer, MailResultModel result)
 {
     this.Data = data;
     this.Emailer = mailer;
     this.Result = result;
 }