public static IEnumerable <Contact> GetByTag(this IContactService service, int tagId,
                                                     Action <IQueryBuilder <Contact> > queryBuilder,
                                                     Action <IProjection <Contact> > projection)
        {
            IMethodListener listener = service.MethodListenerProvider.GetListener();

            var serviceAccessor = new InfusionSoftClient(service.Configuration)
            {
                MethodListener = listener
            };

            IDataService dataService = serviceAccessor.DataService;

            var results = new HashSet <Contact>(Contact.IdComparer);

            results.UnionWith(dataService.Query(query =>
            {
                query.Add(c => c.Groups, string.Format("{0}", tagId), ValuePosition.Default);
                queryBuilder(query);
            }, projection));

            results.UnionWith(dataService.Query(query =>
            {
                query.Add(c => c.Groups, string.Format("{0},", tagId), ValuePosition.StartsWith);
                queryBuilder(query);
            }, projection));

            results.UnionWith(dataService.Query(query =>
            {
                query.Add(c => c.Groups, string.Format(",{0},", tagId), ValuePosition.Contains);
                queryBuilder(query);
            }, projection));

            results.UnionWith(dataService.Query(query =>
            {
                query.Add(c => c.Groups, string.Format(",{0}", tagId), ValuePosition.EndsWith);
                queryBuilder(query);
            }, projection));

            return(results);
        }
 public MethodListenerXmlRpcLogger(IMethodListener listener)
 {
     _listener = listener;
 }