https://github.com/crequency/common.basichelper
Basic utils for all C# projects
https://github.com/crequency/common.basichelper
core dotnet general-library library
Last synced: 12 months ago
JSON representation
Basic utils for all C# projects
- Host: GitHub
- URL: https://github.com/crequency/common.basichelper
- Owner: Crequency
- License: agpl-3.0
- Created: 2022-12-01T03:36:37.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-01T17:38:17.000Z (over 1 year ago)
- Last Synced: 2025-04-12T06:04:50.825Z (about 1 year ago)
- Topics: core, dotnet, general-library, library
- Language: C#
- Homepage:
- Size: 533 KB
- Stars: 11
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
Common.BasicHelper
# About
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
```shell
dotnet add package Common.BasicHelper
```
# Samples
We provide some samples in `Commong.BasicHelper.Samples` project.
To run this project, just run commands:
```shell
cd Common.BasicHelper.Samples
dotnet run
```
The output will looks like ...
```plaintext
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:
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:
```
`` label is the port number of the server.
Then you can visit `http://localhost:/swagger/index.html` to see the samples.
# Usage
## Math
### Calculate
With `Expression` class and `Calculator` class, you can calculate your calculation.
See examples of [Expression](./Common.BasicHelper.Test/Math/Expression_Tests.cs) class and [Calculator](./Common.BasicHelper.Test/Math/Calculator_Tests.cs) class.
## Extensions
You can use follow namespace to use extensions:
```CSharp
using Common.BasicHelper.Utils.Extensions;
```
Such as extensions in `QueueHelper`:
```CSharp
var queue = new Queue()
.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:
```CSharp
"help".ExecuteAsCommand();
```
And you can pass arguments through parameters `args`.
## More
More extensions can be find in our docs later.
We will be appreciate if you can help us with docs site.