/// <summary>
 /// Build a DD4T Target group from a AM Target Group
 /// </summary>
 public static Dynamic.TargetGroup BuildTargetGroup(Tridion.ContentManager.AudienceManagement.TargetGroup targetGroup)
 {
     var tg = new Dynamic.TargetGroup
     {
         Conditions = MapConditions(targetGroup.Conditions),
         Description = targetGroup.Description,
         Id = targetGroup.Id,
         OwningPublication = PublicationBuilder.BuildPublication(targetGroup.OwningRepository),
         Publication = PublicationBuilder.BuildPublication(targetGroup.ContextRepository),
         PublicationId = targetGroup.ContextRepository.Id,
         Title = targetGroup.Title
     };
     return tg;
 }
        /// <summary>
        /// Build a DD4T Target group from a AM Target Group
        /// </summary>
        public static Dynamic.TargetGroup BuildTargetGroup(Tridion.ContentManager.AudienceManagement.TargetGroup targetGroup, BuildManager buildManager)
        {
            var tg = new Dynamic.TargetGroup
            {
                Conditions        = MapConditions(targetGroup.Conditions, buildManager),
                Description       = targetGroup.Description,
                Id                = targetGroup.Id,
                OwningPublication = PublicationBuilder.BuildPublication(targetGroup.OwningRepository),
                Publication       = PublicationBuilder.BuildPublication(targetGroup.ContextRepository),
                PublicationId     = targetGroup.ContextRepository.Id,
                Title             = targetGroup.Title
            };

            return(tg);
        }