https://github.com/alastairlundy/dotprimitives
https://github.com/alastairlundy/dotprimitives
csharp dotnet dotnet-library dotnet-standard primitives
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/alastairlundy/dotprimitives
- Owner: alastairlundy
- License: mit
- Created: 2025-12-17T13:10:16.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2026-04-13T13:43:55.000Z (2 months ago)
- Last Synced: 2026-04-13T15:29:23.856Z (2 months ago)
- Topics: csharp, dotnet, dotnet-library, dotnet-standard, primitives
- Language: C#
- Homepage:
- Size: 1.04 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Security: SECURITY.md
Awesome Lists containing this project
README
# DotPrimitives
My C# primitives library for adding new types and features.
## Primitives Included
### Added Types
* ``DateSpan`` - Represents a span of time as represented by days, months, or years, between two dates.
* ``WindowsFilePermission`` - Represents Windows file permissions.
* ``LineEndingFormat`` - Enum for representing line endings.
* ``DeperecatedAttribute`` - Attribute for marking types and members as deprecated for eventual removal.
### Static Helpers
* ``ExceptionThrower`` - Throws exceptions cleanly with or without a message.
* ``LineEndingDetector`` - Detect line endings in a string.
* ``StorageDrives`` - Detect physical and logical storage drives
* ``PathEnvironmentVariable`` - Retrieve path environment variables
* ``WindowsFilePermissionManager`` - Set or Get Windows file permissions for a file.
## Getting Started
### Support
This can be added to any .NET Standard 2.0, .NET 8, .NET 9, or .NET 10 supported project.
### Pre-requisites
### Installation
* [Nuget](https://nuget.org/packages/AlastairLundy.DotPrimitives) or ``dotnet add package DotPrimitives``
## License
DotPrimitives is licensed under the MIT licence.
See ``LICENSE.txt`` for more information.
## Acknowledgements
Thanks to the following projects for their great work:
* [Polyfill](https://github.com/SimonCropp/Polyfill) for simplifying .NET Standard 2.0 support
* Microsoft's [System.ComponentModel.Annotations](https://www.nuget.org/packages/System.ComponentModel.Annotations) package for .NET Standard - This is used to enable .NET Standard 2.0 support on DotPrimitives's attributes.
* Microsoft's [Microsoft.Bcl.HashCode](https://github.com/dotnet/maintenance-packages) for providing a backport of the HashCode class and static methods to .NET Standard 2.0