public void Context() { _templateId = 89; _template = EmailTemplateBuilder.New .WithId(_templateId) .WithInitialHtml("12345") .WithVariable(1, 1) .WithVariable(1, 1) .Build(); var emailTemplateDto = new EmailTemplateDto { EmailTemplateId = _templateId, Parts = new[] { new EmailTemplatePartDto { PartId = _template.Parts.First().Id, PartType = PartType.Html, Html = "A" }, new EmailTemplatePartDto { PartId = _template.Parts.ElementAt(3).Id, PartType = PartType.Variable, VariableValue = "B" }, new EmailTemplatePartDto { PartId = _template.Parts.ElementAt(4).Id, PartType = PartType.Html, Html = "C" }, }, Name = TemplateName }; _template.Update(emailTemplateDto); }