GetCount() public méthode

public GetCount ( ) : string
Résultat string
Exemple #1
0
        public List<Build> GetBuilds(Action<IBuildHavingBuilder> having, Action<CountBuilder> count, Action<BuildIncludeBuilder> include)
        {
            var buildHavingBuilder = m_BuildHavingBuilderFactory.CreateBuildHavingBuilder();
            having(buildHavingBuilder);
            var buildIncludeBuilder = new BuildIncludeBuilder();
            include(buildIncludeBuilder);
            var countBuilder = new CountBuilder();
            count(countBuilder);

            var locator = buildHavingBuilder.GetLocator();
            var parts = countBuilder.GetCount();
            var columns = buildIncludeBuilder.GetColumns();
            var buildWrapper = m_Caller.GetFormat<BuildWrapper>("/app/rest/builds?locator={0},count:{1},&fields=count,build({2})",
                locator, parts, columns);
            if (int.Parse(buildWrapper.Count) > 0)
            {
                return buildWrapper.Build;
            }
            return new List<Build>();
        }
        private BuildWrapper GetBuildWrapper(BuildHavingBuilder buildHavingBuilder, CountBuilder countBuilder,
            BuildIncludeBuilder buildIncludeBuilder)
        {
            var locator = buildHavingBuilder.GetLocator();
            var count = countBuilder.GetCount();
            var columns = buildIncludeBuilder.GetColumns();

            if (string.IsNullOrEmpty(count))
            {
                return m_Caller.GetFormat<BuildWrapper>("/app/rest/builds?locator={0},&fields=count,build({1})", locator,
                    columns);
            }

            return m_Caller.GetFormat<BuildWrapper>("/app/rest/builds?locator={0},{1},&fields=count,build({2})",
                locator, count, columns);
        }