public async Task <TModel> Read(int id, string date) { JObject json = await APIUtils.GetAsync(IPConfig.GetTotalUrlUser() + id + JsonDataConfig.Url + EndUrl(Request, date)); return((json == null) ? null : (json[JsonDataConfig.Root] as JObject)?.GetObject <TModel>()); }
public async Task <object> Update(int id, [FromBody] Models.PatientData.GoalCaloriesOut item) { var goalCaloriesJson = new JObject { { JsonDataConfig.Root, JObject.Parse(JsonConvert.SerializeObject(item, serializerSettings)) } }; await APIUtils.PostAsync(IPConfig.GetTotalUrlUser() + id + JsonDataConfig.Url, goalCaloriesJson.ToString()); return(Empty); }
private static void Add_Item(ReadStream rs) { int id = rs.ReadInt(); string name = rs.ReadString(); string ip = rs.ReadString(); int port = rs.ReadInt(); string url = rs.ReadString(); int type = rs.ReadInt(); IPConfig new_obj_IPConfig = new IPConfig(id, name, ip, port, url, type); if (dic.ContainsKey(id)) { LogWarning("duplicate key: " + id); return; } dic.Add(id, new_obj_IPConfig); array.Add(new_obj_IPConfig); }