SmartScalarDateTimeTypeHandler`1
Namespace: MJCZone.DapperMatic.TypeMapping.Handlers
Assembly: MJCZone.DapperMatic
Summary
Smart type handler for scalar DateOnly, TimeOnly, and DateTimeOffset values with runtime provider detection. PostgreSQL: Uses native date/time types with Npgsql 9.x compatibility. Other providers: Uses native support where available, string conversion for SQLite.
Inheritance
Base Class: TypeHandler
public
Contents
Constructors (1) | Methods (6)
Constructors
SmartScalarDateTimeTypeHandler`1
SmartScalarDateTimeTypeHandler`1()Methods
| Method | Summary |
|---|---|
| SetValue | Sets the parameter value for a scalar temporal value. PostgreSQL: Passes value directly (Npgsql hand... |
| Parse | Parses the database value to a temporal type. Handles Npgsql 9.x compatibility conversions (DateTime... |
| GetType | |
| ToString | |
| Equals | |
| GetHashCode |
SetValue
Sets the parameter value for a scalar temporal value. PostgreSQL: Passes value directly (Npgsql handles conversion). Other providers: Passes value directly (native support). SQLite: May require string conversion.
void SetValue(IDbDataParameter parameter, Nullable{`0} value)Parameters
- parameter (IDbDataParameter) - The database parameter to set.
- value (Nullable{`0}) - The temporal value to store.
Parse
Parses the database value to a temporal type. Handles Npgsql 9.x compatibility conversions (DateTime ↔ DateOnly, TimeSpan ↔ TimeOnly).
T? Parse(object value)Parameters
- value (object) - The database value to parse.
Returns
Type: T?
The parsed temporal value, or null if the value is null or DBNull.
GetType
GetType()ToString
ToString()Equals
Equals()GetHashCode
GetHashCode()