Skip to content

Commit 26156d4

Browse files
author
Colin Young
committed
Fix MaxLengh when storing as enum
1 parent 37b036b commit 26156d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Serilog.Sinks.MSSqlServer/Sinks/MSSqlServer/MSSqlServerSink.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ DataTable CreateDataTable()
174174
eventsTable.Columns.Add(new DataColumn
175175
{
176176
DataType = _columnOptions.Level.StoreAsEnum ? typeof(byte) : typeof(string),
177-
MaxLength = _columnOptions.Level.StoreAsEnum ? 0 : 128,
177+
MaxLength = _columnOptions.Level.StoreAsEnum ? -1 : 128,
178178
ColumnName = _columnOptions.Level.ColumnName ?? StandardColumn.Level.ToString()
179179
});
180180
break;

0 commit comments

Comments
 (0)