void SaveToDB() { var dh = new DatabaseDataProvider(); var connectionStr = ConfigurationManager.ConnectionStrings["MarketDataConnectionString"].ConnectionString; dh.GetDatabaseConnection = () => { return(new SqlConnection(connectionStr)); }; dh.DeleteBatch(null, "Table_Instruments", new List <string>() { "Ticker" }, InstrumentList.Cast <object>().ToList()); dh.InsertBatch(null, "Table_Instruments", InstrumentList.Cast <object>().ToList()); }