CockroachDbType

This attribute sets the CockroachDbParameter.CockroachDbType property value via a class property.

This attribute sets the CockroachDbParameter.CockroachDbType property value via a class property.

Attribute

Example usage:

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

    [CockroachDbType(CockroachDbType.Integer)]
    public int Age { get; set; }
}

Fluent Mapping

To configure via FluentMapper:

FluentMapper
    .Entity<Person>()
    .PropertyValueAttributes(e => e.Age, new CockroachDbTypeAttribute(CockroachDbType.Integer));

Retrieval

Retrieve the attribute via PropertyValueAttributeCache:

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

We strongly recommend using PropertyValueAttributeCache for maximum performance.