mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-04-22 10:42:52 +08:00
Merge branch 'master' of https://github.com/dotnetcore/FreeSql
This commit is contained in:
commit
86088ed2c3
2
.github/workflows/docfx.yml
vendored
2
.github/workflows/docfx.yml
vendored
@ -40,7 +40,7 @@ jobs:
|
||||
- name: Remove FreeSql.Tests
|
||||
run: dotnet sln FreeSql.sln remove (ls -r FreeSql.Tests/**/*.csproj)
|
||||
- name: Install dependencies
|
||||
run: dotnet nuget add source https://api.nuget.org/v3/index.json -n nuget.org --configfile $env:APPDATA\NuGet\NuGet.Config && dotnet restore
|
||||
run: dotnet restore
|
||||
- name: Setup DocFX
|
||||
uses: crazy-max/ghaction-chocolatey@v1
|
||||
with:
|
||||
|
6
.gitignore
vendored
6
.gitignore
vendored
@ -244,4 +244,8 @@ ModelManifest.xml
|
||||
.paket/paket.exe
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
.fake/
|
||||
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
*.sln.iml
|
@ -7,6 +7,7 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
|
||||
@ -65,12 +66,22 @@ namespace FreeSql.PostgreSQL
|
||||
{
|
||||
var pgdics = isdic ? param as Dictionary<string, string> :
|
||||
param as IEnumerable<KeyValuePair<string, string>>;
|
||||
if (pgdics == null) return string.Concat("''::hstore");
|
||||
var pghstore = new StringBuilder();
|
||||
pghstore.Append("'");
|
||||
foreach (var dic in pgdics)
|
||||
pghstore.Append("\"").Append(dic.Key.Replace("'", "''")).Append("\"=>")
|
||||
.Append(dic.Key.Replace("'", "''")).Append(",");
|
||||
|
||||
var pghstore = new StringBuilder("'");
|
||||
var pairs = pgdics.ToArray();
|
||||
|
||||
for (var i = 0; i < pairs.Length; i++)
|
||||
{
|
||||
if (i != 0) pghstore.Append(",");
|
||||
|
||||
pghstore.AppendFormat("\"{0}\"=>", pairs[i].Key.Replace("'", "''"));
|
||||
|
||||
if (pairs[i].Value == null)
|
||||
pghstore.Append("NULL");
|
||||
else
|
||||
pghstore.AppendFormat("\"{0}\"", pairs[i].Value.Replace("'", "''"));
|
||||
}
|
||||
|
||||
return pghstore.Append("'::hstore");
|
||||
}
|
||||
else if (param is IEnumerable)
|
||||
|
Loading…
x
Reference in New Issue
Block a user