public static void Start(SchemaBuilder sb) { if (sb.NotDefined(MethodInfo.GetCurrentMethod())) { sb.Include <EmailMasterTemplateEntity>() .WithQuery(() => t => new { Entity = t, t.Id, t.Name, }); EmailMasterTemplateGraph.Register(); Validator.PropertyValidator <EmailMasterTemplateEntity>(et => et.Messages).StaticPropertyValidation += (et, pi) => { var dc = EmailLogic.Configuration.DefaultCulture; if (!et.Messages.Any(m => dc.Name.StartsWith(m.CultureInfo.Name))) { return(EmailTemplateMessage.ThereMustBeAMessageFor0.NiceToString().FormatWith(CultureInfoLogic.EntityToCultureInfo.Value.Keys.Where(c => dc.Name.StartsWith(c.EnglishName)).CommaOr(a => a.EnglishName))); } return(null); }; UserAssetsImporter.Register <EmailMasterTemplateEntity>("EmailMasterTemplate", EmailMasterTemplateOperation.Save); } }
public static void Start(SchemaBuilder sb, DynamicQueryManager dqm) { if (sb.NotDefined(MethodInfo.GetCurrentMethod())) { sb.Include <EmailMasterTemplateEntity>() .WithQuery(dqm, () => t => new { Entity = t, t.Id, t.Name, }); EmailMasterTemplateGraph.Register(); Validator.PropertyValidator <EmailMasterTemplateEntity>(et => et.Messages).StaticPropertyValidation += (et, pi) => { if (!et.Messages.Any(m => m.CultureInfo.Is(EmailLogic.Configuration.DefaultCulture))) { return(EmailTemplateMessage.ThereMustBeAMessageFor0.NiceToString().FormatWith(EmailLogic.Configuration.DefaultCulture.EnglishName)); } return(null); }; } }