Example #1
0
        public Emails(string subject, IEnumerable <Address> to, IEnumerable <Address> cc, string body)
        {
            DomainException.When(!string.IsNullOrEmpty(subject), "Subject is required!");
            DomainException.When(to.Count() == 0, "Email receiver is required!");
            DomainException.When(cc.Count() == 0, "Email copied receiver is required!");
            DomainException.When(!string.IsNullOrEmpty(body), "Body is required!");

            Subject = subject;
            To      = to;
            Cc      = cc;
            Body    = body;
        }