You must specify a generic type parameter in the method signature:
public static class CSVExtensions { public static void WriteToCSVFile<T>(this IEnumerable<T> myList) {
Are you really trying to write an extension method that should work on any IEnumerable<T> or is your type more specific? If in the latter case, you must replace T with the type you want to support (or add sufficient restrictions).
Edit:
In light of the comments - you should project the class instead of the anonymous type in your query - then you can use the extension method for this particular type, that is:
class CompanyTicker { public string CUSIP {get;set;} public string CompName {get;set;} public string Exchange {get;set;} }
Now your request could be:
var CAquery = from temp in CAtemp join casect in CAdb.sectors on temp.sector_code equals casect.sector_code select new CompanyTicker { CUSIP = temp.equity_cusip, CompName = temp.company_name, Exchange = temp.primary_exchange };
And your extension method (which now does not have to be general):
public static class CSVExtensions { public static void WriteToCSVFile(this IEnumerable<CompanyTicker> myList) {
source share