Skip to content

SmartArrayTypeHandler`1

Namespace: MJCZone.DapperMatic.TypeMapping.Handlers

Assembly: MJCZone.DapperMatic

Summary

Smart type handler for T[] arrays with runtime provider detection. PostgreSQL: Uses native array types (text[], int4[], etc.) for 10-50x performance boost. Other providers: Uses JSON array serialization for cross-database compatibility.

Inheritance

Base Class: TypeHandler

public

Contents

Constructors (1) | Methods (6)

Constructors

SmartArrayTypeHandler`1

csharp
SmartArrayTypeHandler`1()

Methods

MethodSummary
SetValueSets the parameter value for an array. PostgreSQL: Passes array directly (Npgsql converts T[] to nat...
ParseParses the database value to an array. PostgreSQL: Returns native array directly (T[]). Other provid...
GetType
ToString
Equals
GetHashCode

SetValue

Sets the parameter value for an array. PostgreSQL: Passes array directly (Npgsql converts T[] to native PostgreSQL array). Other providers: Serializes array to JSON string.

csharp
void SetValue(IDbDataParameter parameter, `0[] value)

Parameters

  • parameter (IDbDataParameter) - The database parameter to set.
  • value (`0[]) - The array value to store.

Parse

Parses the database value to an array. PostgreSQL: Returns native array directly (T[]). Other providers: Deserializes from JSON string.

csharp
T[]? Parse(object value)

Parameters

  • value (object) - The database value to parse.

Returns

Type: T[]?

The parsed array, or null if the value is null or DBNull.

GetType

csharp
GetType()

ToString

csharp
ToString()

Equals

csharp
Equals()

GetHashCode

csharp
GetHashCode()