Skip to content

Enhancement: Add the attribute-based parameter setters for the DbParameter object. #886

@mikependon

Description

@mikependon

Describe the enhancement

To further support the setting of most properties of the DbParameter object before the actual execution, please add following attributes.

Usage

public class EntityClass
{
      [DbTypeAttribute(DbType.String)]
      [DirectionAttribute(ParameterDirection.Input)]
      [NameAttribute("CompleteName")]
      [PrecisionAttribute(1)]
      [ScaleAttribute(10)]
      [SizeAttribute(256)]
      public string Name { get; set; }
}

DbParameter

Add the following attributes.

  • DbTypeAttribute
  • DirectionAttribute
  • IsNullableAttribute
  • NameAttribute
  • PrecisionAttribute
  • ScaleAttribute
  • SizeAttribute

All the mentioned attributes must inherit from the PropertyValueAttribute attribute.

SqlParameter (SQL Server)

  • CompareInfoAttribute
  • DataTypeNameAttribute
  • ForceColumnEncryptionAttribute
  • LocaleIdAttribute
  • OffsetAttribute
  • SqlDbTypeAttribute
  • XmlSchemaCollectionNameAttribute
  • XmlSchemaCollectionDatabaseAttribute
  • XmlSchemaCollectionOwningSchemaAttribute

NpgsqlParameter (PostgreSQL)

  • ConvertedValueAttribute
  • DataTypeNameAttribute
  • NpgsqlDbTypeAttribute

MySqlParameter (MySQL)

  • MySqlDbTypeAttribute

MySqlParameter (MySQL Connector)

  • MySqlDbTypeAttribute

SQLiteParameter (System)

  • TypeNameAttribute

SqliteParameter (Microsoft)

  • SqliteTypeAttribute

Metadata

Metadata

Assignees

Labels

deployedFeature or bug is deployed at the current releaseenhancementNew feature or requestfixedThe bug, issue, incident has been fixed.priorityTop priority feature or things to dotodoThings to be done in the future

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions