Beispiel #1
0
        public async Task <int> save(ErrorClass item)
        {
            Dictionary <string, string> parameters = new Dictionary <string, string>();
            string method    = "errorcontroller/Save";
            var    myContent = JsonConvert.SerializeObject(item);

            parameters.Add("itemObject", myContent);
            return(await APIResult.post(method, parameters));
        }
Beispiel #2
0
        public async Task <ErrorClass> getById(int itemId)
        {
            ErrorClass item = new ErrorClass();
            Dictionary <string, string> parameters = new Dictionary <string, string>();

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

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