コード例 #1
0
        private static ApplicationListResult GetApplicationListResult()
        {
            ApplicationListResult appList = new ApplicationListResult();

            appList.Applications = GetObjects <ApplicationGetResult>(1);

            return(appList);
        }
コード例 #2
0
        public static IDictionary <R0042AssetKey, DataMap> BuildIdMap(ApplicationListResult dbList)
        {
            IDictionary <R0042AssetKey, DataMap> map = new Dictionary <R0042AssetKey, DataMap>();

            foreach (var attributeHolder in dbList.ResultObject)
            {
                var assetId  = attributeHolder.GetAttribute("assetid").ToString();
                var siteid   = attributeHolder.GetAttribute("siteid").ToString();
                var assetnum = attributeHolder.GetAttribute("assetnum").ToString();

                map.Add(new R0042AssetKey {
                    AssetId = assetId, AssetNum = assetnum, SiteId = siteid
                }, (DataMap)attributeHolder);
            }

            return(map);
        }
コード例 #3
0
        public async ValueTask <ResponseWithHeaders <ApplicationListResult, ListHeaders> > ListAsync(ApplicationListOptions applicationListOptions, CancellationToken cancellationToken = default)
        {
            using var scope = clientDiagnostics.CreateScope("ApplicationClient.List");
            scope.Start();
            try
            {
                using var message = CreateListRequest(applicationListOptions);
                await pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false);

                var headers = new ListHeaders(message.Response);
                switch (message.Response.Status)
                {
                case 200:
                {
                    ApplicationListResult value = default;
                    using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false);

                    value = ApplicationListResult.DeserializeApplicationListResult(document.RootElement);
                    return(ResponseWithHeaders.FromValue(value, headers, message.Response));
                }