Open KIMBEOBWOO opened 1 year ago
However, if you modify the AutoMap Decorator in the Entity file as follows, it will work fine.
@AutoMap(() => String) // <-- implicit String constructor
@Column({ type: 'text', nullable: true })
test?: string | null;
However, if you modify the AutoMap Decorator in the Entity file as follows, it will work fine.
@AutoMap(() => String) // <-- implicit String constructor @Column({ type: 'text', nullable: true }) test?: string | null;
Hi, this is doesn't work for me(
Only if I add @AutoMap(() => String)
both to the entity and dto.
What if the value is Enum ?
Is there an existing issue for this?
Describe the issue
If you specify a null property type for an Entity class as a Union type such as "string | null", the property is not automatically mapped.
Models/DTOs/VMs
In Destination class file test.entity.ts
In Source class file test.dto.ts
Mapping configuration
No response
Steps to reproduce
Expected behavior
The results I expected are as follows
But in reality,
Screenshots
No response
Minimum reproduction code
No response
Package
Other package and its version
No response
AutoMapper version
8.7.7
Additional context
No response