-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#884 Added the new type map attribute for the Microsoft SqLite.
- Loading branch information
1 parent
5761218
commit 27d294d
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
RepoDb.SqLite/RepoDb.SqLite/Attributes/SqliteParameterDbTypeAttribute.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Microsoft.Data.Sqlite; | ||
using System; | ||
|
||
namespace RepoDb.Attributes | ||
{ | ||
/// <summary> | ||
/// An attribute that is used to define a mapping of .NET CLR <see cref="Type"/> into its equivalent <see cref="SqliteType"/> value. | ||
/// </summary> | ||
public class SqliteParameterDbTypeAttribute : ParameterPropertyValueSetterAttribute | ||
{ | ||
/// <summary> | ||
/// Creates a new instance of <see cref="SqliteParameterDbTypeAttribute"/> class. | ||
/// </summary> | ||
/// <param name="value">A target <see cref="SqliteType"/> value.</param> | ||
public SqliteParameterDbTypeAttribute(SqliteType value) | ||
: base(typeof(SqliteParameter), nameof(SqliteParameter.SqliteType), value) | ||
{ } | ||
|
||
/// <summary> | ||
/// Gets a <see cref="SqliteType"/> that is currently mapped. | ||
/// </summary> | ||
public SqliteType SqliteType => (SqliteType)Value; | ||
} | ||
} |