Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string json = new WebClient().DownloadString("http://api.bitcoincharts.com/v1/weighted_prices.json");
- JObject jo = JObject.Parse(json);
- foreach (Currency c in db.Currencies.Where(x => x.Enabled))
- {
- if (c.FXRate == null) c.FXRate = new FXRate();
- c.FXRate.Value = Convert.ToDecimal(jo[c.ISO]["7d"].ToString());
- c.FXRate.EffectiveTs = DateTime.Now;
- }
- db.SaveChanges();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement