public string GetJSONStock(int day) { foreach(SheepBO anim in this.Herd) { if (anim.Age.Value >= 1000) this.Herd.Remove(anim); } HerdResponse resp = new HerdResponse(this.Herd); string json = new JavaScriptSerializer().Serialize(resp); return json.Replace("_", "-"); }
public string GetJSONStock(int day) { foreach (SheepBO anim in this.Herd) { if (anim.Age.Value >= 1000) { this.Herd.Remove(anim); } } HerdResponse resp = new HerdResponse(this.Herd); string json = new JavaScriptSerializer().Serialize(resp); return(json.Replace("_", "-")); }