Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

LinqToDBPostgreSQLDataProvider.cs

using System.Data.Common;
using LinqToDB;
using LinqToDB.Common;
using LinqToDB.Data;
using LinqToDB.DataProvider.PostgreSQL;

namespace Nop.Data.DataProviders.LinqToDB;

/// 
/// Represents a data provider for PostgreSQL
/// 
public partial class LinqToDBPostgreSQLDataProvider : PostgreSQLDataProvider
{
    public LinqToDBPostgreSQLDataProvider() : base(ProviderName.PostgreSQL, PostgreSQLVersion.v95) { }

    public override void SetParameter(DataConnection dataConnection, DbParameter parameter, string name, DbDataType dataType, object value)
    {

        if (value is string && dataType.SystemType == typeof(string))
        {
            dataType = dataType.WithDbType("citext");
        }

        base.SetParameter(dataConnection, parameter, name, dataType, value);
    }
}