Skip to content

v10.0.6

Choose a tag to compare

@DocSvartz DocSvartz released this 26 Mar 01:13
e192f41

Breaking change in v10.0+ and new feature

New feature:

  • Fix #883 - Add class ctor using default value for param

In version 7.4.0 this feature was only available for record types

If you encountered this mapping behavior in 7.4.0, it is possible that your class was recognized as a record type, or was mistakenly recognized as a record type See more.

If you need the mapping behavior as for Record, in v10.0+ you can use - [AdaptWith(AdaptDirectives.DestinationAsRecord)] .
If you need the ability to set this setting without using attributes, open issue on this topic.

Example:

[AdaptWith(AdaptDirectives.DestinationAsRecord)]
public class SimpleRecord
{
    public int Id { get; private set; }
    public string Name { get; private set; }

    public SimpleRecord(int id, string name)
    {
        this.Id = id;
        this.Name = name;
    }
}

What's Changed

  • fix: #893 by @DocSvartz in #894
  • fix: Regression in v10 - disabled ConstructUsing and MapToConstructor if have public parameterless constructor by @DocSvartz in #896

Full Changelog: v10.0.4...v10.0.6