AuroraDbType

This attribute sets the AuroraDbParameter.AuroraDbType property value via a class property.

This attribute sets the AuroraDbParameter.AuroraDbType property value via a class property.

Works with the MySqlConnector-based RepoDb.Connector.AuroraDb.MySqlConnector package, via RepoDb.AuroraDb.MySqlConnector.

Attribute

Example usage:

public class Person
{
    public int Id { get; set; }

    [AuroraDbType(AuroraDbType.Text)]
    public string Name { get; set; }
}

Fluent Mapping

To configure via FluentMapper:

FluentMapper
    .Entity<Person>()
    .PropertyValueAttributes(e => e.Name, new AuroraDbTypeAttribute(AuroraDbType.Text));

Retrieval

Retrieve the attribute via PropertyValueAttributeCache:

var attribute = PropertyValueAttributeCache
    .Get<Person>(e => e.Name)?
    .FirstOrDefault(e => e.GetType() == typeof(AuroraDbTypeAttribute));

We strongly recommend using PropertyValueAttributeCache for maximum performance.

RepoDb.AuroraDb.PostgreSql ships its own, separately-compiled AuroraDbTypeAttribute type under the same namespace and simple name. They are not interchangeable — use the one that comes from whichever of RepoDb.AuroraDb.MySqlConnector or RepoDb.AuroraDb.PostgreSql your project references.