public void Insert(Serving entity) { List <Serving> servings = GetJsonData(); servings.Add(entity); UpdateJsonData(servings); }
public void Update(Serving entity) { List <Serving> servings = GetJsonData(); int index = servings.FindIndex(s => s.Id == entity.Id); servings[index] = entity; UpdateJsonData(servings); }