コード例 #1
0
        public async Task <int> Save(AgentPackage obj)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();
            string method = urimainpath + "Save";

            var myContent = JsonConvert.SerializeObject(obj);

            parameters.Add("Object", myContent);
            return(await APIResult.post(method, parameters));
        }
コード例 #2
0
        public async Task <AgentPackage> GetByID(int agentPackageId)
        {
            AgentPackage item = new AgentPackage();
            Dictionary <string, string> parameters = new Dictionary <string, string>();

            parameters.Add("agentPackageId", agentPackageId.ToString());
            //#################
            IEnumerable <Claim> claims = await APIResult.getList(urimainpath + "GetByID", parameters);

            foreach (Claim c in claims)
            {
                if (c.Type == "scopes")
                {
                    item = JsonConvert.DeserializeObject <AgentPackage>(c.Value, new IsoDateTimeConverter {
                        DateTimeFormat = "dd/MM/yyyy"
                    });
                    break;
                }
            }

            return(item);
        }