如何调用类或使用什么模式?

时间:2013-08-05 18:26:45

标签: c# design-patterns

我有MailManager它有公共方法,如:

public MailMessage ConfirmationEmail(CommonTicketEmailViewModel viewModel)
        {
            var template = ReadTemplate("ConfirmationEmail.cshtml");
            string result = Razor.Parse(template, new { ConfirmationUrl = viewModel.Url, Token = viewModel.Code });

            var mailMessage = new MailMessage();
            mailMessage.Subject = "Confirmation E-mail";
            mailMessage.Body = result;
            mailMessage.IsBodyHtml = true;
            mailMessage.To.Add(viewModel.ToEmail);

            return mailMessage;
        }

这个类只是准备MailMessage发送。请问这个班有多正确?

1 个答案:

答案 0 :(得分:0)

MailMessageUtilitiesMailMessageFactory怎么样?