Skip to content

reading the Unicode parameter defined in the Code First mapping #1045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public class FbStringTypeMapping : StringTypeMapping
{
readonly FbDbType _fbDbType;

public FbStringTypeMapping(string storeType, DbType dbType, FbDbType fbDbType, int? size = null)
: base(storeType, dbType, unicode: true, size: size)
public FbStringTypeMapping(string storeType, DbType dbType, FbDbType fbDbType, int? size = null, bool unicode = true)
: base(storeType, dbType, unicode: unicode, size: size)
{
_fbDbType = fbDbType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ RelationalTypeMapping FindRawMapping(RelationalTypeMappingInfo mappingInfo)
var clrType = mappingInfo.ClrType;
var storeTypeName = mappingInfo.StoreTypeName;
var storeTypeNameBase = mappingInfo.StoreTypeNameBase;
var isUnicode = mappingInfo.IsUnicode ?? true;

if (storeTypeName != null)
{
Expand Down Expand Up @@ -178,11 +179,11 @@ RelationalTypeMapping FindRawMapping(RelationalTypeMappingInfo mappingInfo)
{
if (!isFixedLength)
{
return new FbStringTypeMapping($"VARCHAR({size})", DbType.String, FbDbType.VarChar, size);
return new FbStringTypeMapping($"VARCHAR({size})", DbType.String, FbDbType.VarChar, size, isUnicode);
}
else
{
return new FbStringTypeMapping($"CHAR({size})", DbType.StringFixedLength, FbDbType.Char, size);
return new FbStringTypeMapping($"CHAR({size})", DbType.StringFixedLength, FbDbType.Char, size, isUnicode);
}
}
}
Expand Down