Skip to content

Commit 72709ca

Browse files
committed
add readme data
1 parent bbe4544 commit 72709ca

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

README.md

+47-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,47 @@
1-
# Simple
1+
# Simple Extensions
2+
This library provides simple and very direct extensions on some basic types of C#, although it
3+
is simple it covers some functionality we need it all the time in many places which sometimes
4+
casue code duplication due to its simplicity.
5+
6+
My intension is to collect as much as I can of these simple functions and group them in
7+
single basic libray to help me and others in doing their tasks in an easy way.
8+
9+
This library is open source and covered with unit tests to ensure its stability and to be
10+
confident to use it in your projects.
11+
12+
In this first release I covered some functions on different C# types and alot is coming
13+
soon as well.
14+
15+
## What covered now:
16+
### String Extensions:
17+
| Method | Description |
18+
| -- | -- |
19+
| IsEmpty() | Return `true` if the value is empty only otherwise return `false` |
20+
| IsNull() | Return `true` if the value is null only otherwise return `false` |
21+
| IsWhiteSpace() | Return `true` if the value is whitespace only otherwise return `false` |
22+
| HasValue() | Return `true` if the string has any value, it is simply a wrapper around `IsNullOrWhiteSpace` without the headache of negation |
23+
| RemoveSpecialCharacters() | Remove any special characters in the string |
24+
| RemoveSpaces() | Remove any spaces in the string |
25+
| RemoveSpecialCharactersAndSpaces() | Remove any special characters or spaces in the string |
26+
27+
### DateTime Extensions:
28+
| Method | Description |
29+
| -- | -- |
30+
| ToUnixTimeStamp() | Convert any `DateTime` to unix timestamp |
31+
32+
### Long Extensions:
33+
| Method | Description |
34+
| -- | -- |
35+
| FromUnixTimeStampToDateTime() | Convert unix timestamp to valid `DateTime` |
36+
37+
### Queryable Extensions:
38+
| Method | Description |
39+
| -- | -- |
40+
| ToPaginatedListAsync\<T> | A very simple method for pagination, it is generic which can work on your main entity or projection type. It takes page number and page size and handle the pagination calculations and returns two objects, the first one is the `IEnumerable<T>` with the specified number of records and meta data object with pagination data |
41+
42+
### Enum Extensions:
43+
| Method | Description |
44+
| -- | -- |
45+
| GetAttribute\<TAttribute> | Direct way to retrieve any attribute data associated with `enum` type whether it is built in attribute as `DescriptionAttribute` or any custom attribute |
46+
47+
You can refer to the unit tests in the repo to see some basic usage for each method.

Simple.Extensions/Simple.Extensions.csproj

+1-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
<RepositoryType>git</RepositoryType>
1818
<RepositoryUrl>https://github.com/tarek-iraqi/Simple-extensions</RepositoryUrl>
1919
<Description>
20-
This is a simple extension library for most basic types in .Net which extending their functionality
21-
to do more useful tasks easy and in clean way without writing to much code or repeat the same simple code
22-
multiple time.
20+
This is a simple extension library for most basic types in .Net which extending their functionality to do more useful tasks easy and in clean way without writing to much code or repeat the same simple code multiple time.
2321
</Description>
2422
<!--<PackageProjectUrl>https://diverse-code.com/projects/simple-extensions</PackageProjectUrl>-->
2523
<PackageTags>simple, library, extensions, base types, C#</PackageTags>

0 commit comments

Comments
 (0)