https://dotnetcoretutorials.com/2018/08/04/csv-parsing-in-net-core/
https://joshclose.github.io/CsvHelper/
class ReturnTest
{
static double CalculateArea(int r)
{
double area = r * r * Math.PI;
return area;
}
static void Main()
{
int radius = 5;
double result = CalculateArea(radius);
Console.WriteLine("The area is {0:0.00}", result);
// Keep the console open in debug mode.
Console.WriteLine("Press any key to exit.");
Console.ReadKey();
}
}
// Output: The area is 78.54
No secret keyword or design here. What happens is that each of these methods returns the instance of the TestServer (simply by returning this):
TestServer DoThis()
{
// method code
return this;
}
TestServer DoThat(string WithThisParameter)
{
// method code
return this;
}
And then you can do this:
var x = new TestServer();
x.DoThis().DoThat("my string").DoThis();
string newfolder = "c:\\TEMP\\bonk";
Console.WriteLine("creating folder "+ newfolder);
Directory.CreateDirectory(newfolder);
// new file https://docs.microsoft.com/en-us/dotnet/core/api/system.io.file
string newfile = (newfolder+"\\bonk.md");
// newfile = Path.GetFullPath(newfile);
Console.Write("creating file "+newfile);
File.Create(newfile);
https://github.com/dotnet/docs/tree/master/samples/csharp/getting-started/console-teleprompter
https://stackoverflow.com/questions/384743/how-to-quickly-code-and-run-small-c-sharp-code
The best suitable solution for me was using the C# Interactive-window. You can access it by opening it via View > Other Windows > C# Interactive, or by selecting some c# code and clicking on Execute in Interactive in the right-click context menu.
todo: snippets
function wrappers
https://docs.microsoft.com/en-us/biztalk/core/how-to-set-deployment-properties-in-visual-studio
get self docs like sphinx
using System;
using System.IO;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
// new directory https://docs.microsoft.com/en-us/dotnet/core/api/system.io.directory
string newfolder = "c:\\TEMP\\bonk";
Console.WriteLine("creating folder "+ newfolder);
Directory.CreateDirectory(newfolder);
// new file https://docs.microsoft.com/en-us/dotnet/core/api/system.io.file
string newfile = (newfolder+"\\bonk.md");
// newfile = Path.GetFullPath(newfile);
Console.Write("creating file "+newfile);
File.Create(newfile);
// new content in the file https://docs.microsoft.com/en-us/dotnet/core/api/system.io.filestream
// string filecontents = @"hi there";
// // Console.Write("writing "+filecontents+" to "+newfile);
// File.WriteAllText("c:\\temp\\bonk\\bonk.md", filecontents);
}
}
}
open terminal
ctrl backtick to open terminal
open project
dotnet new
create dependancies
dotnet restore
run
dotnet run
set breakpoint
click by line number
debug
f5
http://stackoverflow.com/questions/802541/creating-an-empty-file-in-c-sharp
dotnet publish
to run in command dotnet your.dll
install build tools
https://www.microsoft.com/en-us/download/confirmation.aspx?id=48159