public List <Instrument> TestMe(bool test = true) { InstrumentData instrumentList = new InstrumentData(); string instrumentFile = @"F:\Projects\MDX\Future_BTST\Future_BTST\InstrumentList.json"; string instrumentJson = string.Empty; if (System.IO.File.Exists(instrumentFile)) { instrumentJson = System.IO.File.ReadAllText(instrumentFile); } List <Instrument> instrumentDataList = new List <Instrument>(); if (instrumentJson.Length > 0) { instrumentDataList = Newtonsoft.Json.JsonConvert.DeserializeObject <List <Instrument> >(instrumentJson); } else { instrumentDataList = instrumentList.GetUnderlyingForFUT("aw230frvr95ajkzx", "NFO", "NSE", "FUT", "EQ", TimeSpan.FromDays(30)); string jsonData = Newtonsoft.Json.JsonConvert.SerializeObject(instrumentDataList); System.IO.File.WriteAllText(instrumentFile, jsonData); } return(instrumentDataList); }