Skip to content
Open
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
1 change: 1 addition & 0 deletions src/EFCore/Storage/TypeMappingSourceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ protected virtual bool TryFindJsonCollectionMapping(
out JsonValueReaderWriter? collectionReaderWriter)
{
if ((providerClrType == null || providerClrType == typeof(string))
&& modelClrType != typeof(string)
&& modelClrType.TryGetElementType(typeof(IEnumerable<>)) is { } elementType
&& elementType != modelClrType
&& !modelClrType.GetGenericTypeImplementations(typeof(IDictionary<,>)).Any())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,26 @@ public void CreateIndexOperation_unique_datacompression(DataCompressionType data
""");
}

[Fact]
public virtual void AddColumnOperation_mistyped_default_legacy()
{
Generate(
new AddColumnOperation
{
Table = "People",
Name = "Id",
ClrType = typeof(int),
ColumnType = "int",
DefaultValue = "",
IsNullable = false
});

AssertSql(
"""
ALTER TABLE [People] ADD [Id] int NOT NULL DEFAULT N'';
""");
}

[Fact]
public virtual void AddColumnOperation_identity_legacy()
{
Expand Down
Loading