Skip to content
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
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<!-- Properties related to build/pack -->
<IsPackable>false</IsPackable>
<Version>10.0.8-pre03</Version>
<Version>10.0.8-pre04</Version>
<MapsterPluginsTFMs>netstandard2.0;net10.0;net9.0;net8.0</MapsterPluginsTFMs>
<MapsterTFMs>netstandard2.0;net10.0;net9.0;net8.0</MapsterTFMs>
<MapsterEFCoreTFMs>net10.0;net9.0;net8.0</MapsterEFCoreTFMs>
Expand Down
55 changes: 55 additions & 0 deletions src/Mapster.Tests/WhenMappingRecordRegression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,40 @@ public void NotSelfCreationTypeMappingToSelfWithOutError()
resultJ.RootElement.GetProperty("key").ToString().ShouldBe("value");
}

/// <summary>
/// https://github.com/MapsterMapper/Mapster/issues/927
/// </summary>
[TestMethod]
public void MappingToReadOnlyInterfaceUsingIgnoreNulValuesWithoutError()
{
var config = new TypeAdapterConfig();
config
.NewConfig<IDto927, IDomain934>()
.IgnoreNullValues(true);

Should.NotThrow(() => {

config.Compile();
});
}

/// <summary>
/// https://github.com/MapsterMapper/Mapster/issues/927
/// </summary>
[TestMethod]
public void MappingToReadOnlyRecordUsingIgnoreNulValuesWithoutError()
{
var config = new TypeAdapterConfig();
config
.NewConfig<IDto927, Domain927>()
.IgnoreNullValues(true);

Should.NotThrow(() => {

config.Compile();
});
}

#region NowNotWorking

/// <summary>
Expand Down Expand Up @@ -993,5 +1027,26 @@ class InsiderWithCtorDestYx
public AutoCtorDestYx X { set; get; }
}

public interface IDto927
{
string Id { get; set; }
string Value { get; set; }
IList<string> ValueList { get; set; }
}

public interface IDomain934
{
string Id { get; }
string Value { get; }
IList<string> ValueList { get; }
}

public record Domain927
{
string Id { get; }
string Value { get; }
IList<string> ValueList { get; }
}

#endregion TestClasses
}
Loading