DTO mapping exception with entity in ABP

前端 未结 1 400
夕颜
夕颜 2021-01-26 21:13

I got an error about \"mapping\" when I try to insert an entity.

The insert is made by the Create method of a CrudAppService. My entity inherits from

1条回答
  •  醉话见心
    2021-01-26 22:20

    Required mapping direction:

    PostDto -> Post (Destination member list)

    [AutoMapFrom(typeof(Post))] configures Post -> PostDto here:

    [AutoMapFrom(typeof(Post))]
    public class PostDto : EntityDto
    

    To configure for both directions, simply do:

    [AutoMap(typeof(Post))]
    public class PostDto : EntityDto
    

    0 讨论(0)
提交回复
热议问题