As for my previous question , I configured my code to use Generics
as
FileHelperEngine engine; public DateTime ExportResultsToCsv<T>(string filePath, string HeaderLine, List<T> data) { engine = new FileHelperEngine(typeof(T)) { HeaderText = HeaderLine }; engine.WriteFile(filePath, data); return DateTime.Now; }
However, when I tried to integrate it into my code, I encountered the following two errors:
Error 1 The best overloaded method match for 'FileHelpers.FileHelperEngine <object> .WriteFile (string, System.Collections.Generic.IEnumerable <object>)' has some invalid arguments
Error 2 Argument 2: Cannot convert from 'System.Collections.Generic.List <T>' to 'System.Collections.Generic.IEnumerable <object>'
I could not understand what a mistake is. Can someone help with this.
Error line:
engine.WriteFile(filePath, data);
Updates1:
I use FileHelper.dll
to convert Csv files, and FileHelperEngine
refers to this DLL.
Updates2: As @sza suggested, I changed and follow a screenshot of my error.
Thanks in advance.
source share