Пример #1
0
        public contract_type getJsonById(string Id)
        {
            int           intId = int.Parse(Id);
            contract_type check = Yyy.Find(b => b.Id == intId);

            return(check);
        }
Пример #2
0
        public string updateJson(string Id, contract_type item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("Update error");
            }
            int idx = Yyy.FindIndex(b => b.Id == item.Id);

            if (idx == -1)
            {
                return("Impossible to update item of id=" + Id);
            }
            Yyy.RemoveAt(idx);
            Yyy.Add(item);
            return("Updated item of id=" + Id);
        }