Skip to content

Commit

Permalink
#884 Added the new type map attribute for the Microsoft SqLite.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikependon committed Sep 13, 2021

Verified

This commit was signed with the committer’s verified signature. The key has expired.
renovate-bot Mend Renovate
1 parent 5761218 commit 27d294d
Showing 1 changed file with 24 additions and 0 deletions.
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;
}
}

0 comments on commit 27d294d

Please sign in to comment.