Skip to content

CommonProviderCheckExpressions

Namespace: MJCZone.DapperMatic.Models

Assembly: MJCZone.DapperMatic

Summary

Provides common provider-specific check expressions for database columns. These functions generate appropriate check constraint expressions based on the database provider type.

static public

Contents

Methods (8)

Methods

MethodSummary
LengthGreaterThanCheckCreates a check expression for string length greater than specified value. SQL Server uses LEN(), ot...
LengthGreaterThanOrEqualCheckCreates a check expression for string length greater than or equal to specified value. SQL Server us...
LengthLessThanCheckCreates a check expression for string length less than specified value. SQL Server uses LEN(), other...
LengthLessThanOrEqualCheckCreates a check expression for string length less than or equal to specified value. SQL Server uses ...
GetType
ToString
Equals
GetHashCode

LengthGreaterThanCheck

Creates a check expression for string length greater than specified value. SQL Server uses LEN(), others use LENGTH().

csharp
Func<DbProviderType, string> LengthGreaterThanCheck(
    string columnName,
    int length)

Parameters

  • columnName (string) - The column name to check.
  • length (int) - The minimum length (exclusive). Default is 0.

Returns

Type: Func<DbProviderType, string>

A function that generates provider-specific check expressions.

LengthGreaterThanOrEqualCheck

Creates a check expression for string length greater than or equal to specified value. SQL Server uses LEN(), others use LENGTH().

csharp
Func&lt;DbProviderType, string&gt; LengthGreaterThanOrEqualCheck(
    string columnName,
    int length)

Parameters

  • columnName (string) - The column name to check.
  • length (int) - The minimum length (inclusive). Default is 0.

Returns

Type: Func<DbProviderType, string>

A function that generates provider-specific check expressions.

LengthLessThanCheck

Creates a check expression for string length less than specified value. SQL Server uses LEN(), others use LENGTH().

csharp
Func&lt;DbProviderType, string&gt; LengthLessThanCheck(string columnName, int length)

Parameters

  • columnName (string) - The column name to check.
  • length (int) - The maximum length (exclusive).

Returns

Type: Func<DbProviderType, string>

A function that generates provider-specific check expressions.

LengthLessThanOrEqualCheck

Creates a check expression for string length less than or equal to specified value. SQL Server uses LEN(), others use LENGTH().

csharp
Func&lt;DbProviderType, string&gt; LengthLessThanOrEqualCheck(
    string columnName,
    int length)

Parameters

  • columnName (string) - The column name to check.
  • length (int) - The maximum length (inclusive).

Returns

Type: Func<DbProviderType, string>

A function that generates provider-specific check expressions.

GetType

csharp
GetType()

ToString

csharp
ToString()

Equals

csharp
Equals()

GetHashCode

csharp
GetHashCode()