Skip to content

Commit 353b1ea

Browse files
CopilotJerryNixon
andcommitted
Add support for XML data type in MSSQL by treating it as string
Co-authored-by: JerryNixon <1749983+JerryNixon@users.noreply.github.com>
1 parent afb1798 commit 353b1ea

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Core/Models/SqlTypeConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static class SqlTypeConstants
4242
{ "varbinary", true }, // SqlDbType.VarBinary
4343
{ "varchar", true }, // SqlDbType.VarChar
4444
{ "sql_variant", false }, // SqlDbType.Variant (unsupported)
45-
{ "xml", false }, // SqlDbType.Xml (unsupported)
45+
{ "xml", true }, // SqlDbType.Xml
4646
{ "date", true }, // SqlDbType.Date
4747
{ "time", true }, // SqlDbType.Time
4848
{ "datetime2", true }, // SqlDbType.DateTime2

src/Core/Services/TypeHelper.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ public static class TypeHelper
111111
[SqlDbType.TinyInt] = typeof(byte),
112112
[SqlDbType.UniqueIdentifier] = typeof(Guid),
113113
[SqlDbType.VarBinary] = typeof(byte[]),
114-
[SqlDbType.VarChar] = typeof(string)
114+
[SqlDbType.VarChar] = typeof(string),
115+
[SqlDbType.Xml] = typeof(string)
115116
};
116117

117118
private static Dictionary<SqlDbType, DbType> _sqlDbDateTimeTypeToDbType = new()

0 commit comments

Comments
 (0)