Common.BasicHelper is a collection of helper functions for dotnet platform (C# mainly).
You can easily use it in your project through NuGet.
Via dotnet cli
dotnet add package Common.BasicHelper
We provide some samples in Commong.BasicHelper.Samples
project.
To run this project, just run commands:
cd Common.BasicHelper.Samples
dotnet run
The output will looks like ...
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:<port>
info: Microsoft.Hosting.Lifetime[0]
Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
Content root path: <path>
<port>
label is the port number of the server.
Then you can visit http://localhost:<port>/swagger/index.html
to see the samples.
With Expression
class and Calculator
class, you can calculate your calculation.
See examples of Expression class and Calculator class.
You can use follow namespace to use extensions:
using Common.BasicHelper.Utils.Extensions;
Such as extensions in QueueHelper
:
var queue = new Queue<int>()
.Push(1)
.Push(2)
.Pop()
.Push(3)
.Push(4)
.Pop()
.Push(5)
;
queue.Dump(); // Result will be "3 4 5 "
And you can execute a string as a system command:
"help".ExecuteAsCommand();
And you can pass arguments through parameters args
.
More extensions can be find in our docs later.
We will be appreciate if you can help us with docs site.