Link Search Menu Expand Document

OracleDbTypeEx


This attribute sets the OracleParameter.OracleDbTypeEx property value via a class property. Unlike OracleDbType, binding via this property causes the output value to be returned as a plain .NET type instead of an Oracle-specific wrapper type (e.g. plain DateTime instead of OracleDate).

Attribute

Example usage:

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

    [OracleDbTypeEx(OracleDbType.TimeStamp)]
    public DateTime CreatedDateUtc { get; set; }
}

Fluent Mapping

To configure via FluentMapper:

FluentMapper
    .Entity<Person>()
    .PropertyValueAttributes(e => e.CreatedDateUtc, new OracleDbTypeExAttribute(OracleDbType.TimeStamp));

Retrieval

Retrieve the attribute via PropertyValueAttributeCache:

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

We strongly recommend using PropertyValueAttributeCache for maximum performance.