To return a CSV file using C# you need to create a new StreamWriter and add the CSV formatter to your Web API. I have a full example project to demonstrate.