https://github.com/vborovikov/spryer
Enum mapping for Dapper and more
https://github.com/vborovikov/spryer
code-generator csharp dapper dapper-extensions dapper-orm dotnet enums
Last synced: 10 months ago
JSON representation
Enum mapping for Dapper and more
- Host: GitHub
- URL: https://github.com/vborovikov/spryer
- Owner: vborovikov
- License: mit
- Created: 2023-03-20T14:11:11.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-06-14T00:21:14.000Z (12 months ago)
- Last Synced: 2025-07-15T15:02:37.930Z (11 months ago)
- Topics: code-generator, csharp, dapper, dapper-extensions, dapper-orm, dotnet, enums
- Language: C#
- Homepage:
- Size: 280 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spryer
Enum mapping for Dapper and more
[](https://www.nuget.org/packages/Spryer)
[](https://www.nuget.org/packages/Spryer#versions-body-tab)
[](https://github.com/vborovikov/spryer/blob/main/LICENSE)
The project provides a set of utility classes and extension methods, including the `DbEnum` and `DapperExtensions` classes.
## DbEnum
The `DbEnum` class is a generic wrapper around C# enumerations that provides support for storing enum values in a database. It includes methods for converting between enum values and database values, and for serializing and deserializing enum values.
Before using the `DbEnum` class, you must enable its support in Dapper by calling a `DbEnum.Initialize()` method, usually during your application startup.
## DapperExtensions
The `DapperExtensions` class provides a set of extension methods for converting strings to different types of database strings, and for converting enum values to `DbEnum` instances.
## SqlMapperExtensions
The `SqlMapperExtensions` class extends Dapper's `SqlMapper` functionality by providing convenient methods for querying databases and retrieving results as strings or deserialized JSON objects. `QueryTextAsync` method executes a SQL query and returns the result as a single string. `QueryJsonAsync` method executes a SQL query and returns the result as a JSON object.
## DbScriptMap
The `DbScriptMap` class is designed to manage and provide access to a collection of SQL scripts to use with Dapper. These scripts are typically loaded from embedded resources within an assembly or from files on the file system. The class simplifies the process of retrieving and using these scripts within an application.