Example #1
0
        public static IEnumerable <AudienceStateDto> ToAudienceStateDtoCollection(IEnumerable <string> ids)
        {
            var states = new List <AudienceStateDto>();

            foreach (var id in ids)
            {
                var dto = new AudienceStateDto();
                dto.ClientId = id;
                states.Add(dto);
            }
            return(states);
        }
Example #2
0
 public AudienceStateDto Get(string id, string fields = null)
 {
     try {
         var idObj = id;
         var state = (AudienceState)_audienceApplicationService.Get(idObj);
         if (state == null)
         {
             return(null);
         }
         var stateDto = new AudienceStateDto(state);
         if (String.IsNullOrWhiteSpace(fields))
         {
             stateDto.AllFieldsReturned = true;
         }
         else
         {
             stateDto.ReturnedFieldsString = fields;
         }
         return(stateDto);
     } catch (Exception ex) { var response = AudiencesControllerUtils.GetErrorHttpResponseMessage(ex); throw new HttpResponseException(response); }
 }