Skip to content

Commit 4c36da2

Browse files
Keep IsUnicode property for strings mapping (#1045)
1 parent d54b4cf commit 4c36da2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbStringTypeMapping.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ public class FbStringTypeMapping : StringTypeMapping
2626
{
2727
readonly FbDbType _fbDbType;
2828

29-
public FbStringTypeMapping(string storeType, DbType dbType, FbDbType fbDbType, int? size = null)
30-
: base(storeType, dbType, unicode: true, size: size)
29+
public FbStringTypeMapping(string storeType, DbType dbType, FbDbType fbDbType, int? size = null, bool unicode = true)
30+
: base(storeType, dbType, unicode: unicode, size: size)
3131
{
3232
_fbDbType = fbDbType;
3333
}

src/FirebirdSql.EntityFrameworkCore.Firebird/Storage/Internal/FbTypeMappingSource.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ RelationalTypeMapping FindRawMapping(RelationalTypeMappingInfo mappingInfo)
133133
var clrType = mappingInfo.ClrType;
134134
var storeTypeName = mappingInfo.StoreTypeName;
135135
var storeTypeNameBase = mappingInfo.StoreTypeNameBase;
136+
var isUnicode = mappingInfo.IsUnicode ?? true;
136137

137138
if (storeTypeName != null)
138139
{
@@ -178,11 +179,11 @@ RelationalTypeMapping FindRawMapping(RelationalTypeMappingInfo mappingInfo)
178179
{
179180
if (!isFixedLength)
180181
{
181-
return new FbStringTypeMapping($"VARCHAR({size})", DbType.String, FbDbType.VarChar, size);
182+
return new FbStringTypeMapping($"VARCHAR({size})", DbType.String, FbDbType.VarChar, size, isUnicode);
182183
}
183184
else
184185
{
185-
return new FbStringTypeMapping($"CHAR({size})", DbType.StringFixedLength, FbDbType.Char, size);
186+
return new FbStringTypeMapping($"CHAR({size})", DbType.StringFixedLength, FbDbType.Char, size, isUnicode);
186187
}
187188
}
188189
}

0 commit comments

Comments
 (0)