private static void ReadCsvFile(Youtube youtube) { using (var reader = new StreamReader(filePath)) { while (!reader.EndOfStream) { var line = CleanFileData(reader.ReadLine()); var data = line.Split(','); try { YoutubeChannel channel = new YoutubeChannel( data[2], Convert.ToInt64(data[3]), Convert.ToInt64(data[5]), Convert.ToInt64(data[4]) ); youtube.AddChannel(channel); } catch { //data exception } } } }
public void AddChannel(YoutubeChannel NewYoutuber) { youtubeChannel[NewYoutuber.channelName] = NewYoutuber; }