Automapper missing type map configuration or unsupported mapping - Error

前端 未结 12 1552
旧时难觅i
旧时难觅i 2020-11-27 16:25

Entity Model

public partial class Categoies
{
    public Categoies()
    {
        this.Posts = new HashSet();
    }

    public int Id { get; se         


        
12条回答
  •  伪装坚强ぢ
    2020-11-27 17:05

    Where have you specified the mapping code (CreateMap)? Reference: Where do I configure AutoMapper?

    If you're using the static Mapper method, configuration should only happen once per AppDomain. That means the best place to put the configuration code is in application startup, such as the Global.asax file for ASP.NET applications.

    If the configuration isn't registered before calling the Map method, you will receive Missing type map configuration or unsupported mapping.

提交回复
热议问题