'"Unmapped members were found" errors after implementing IMultiTenant interface

I am getting this "Unmapped members were found" after adding IMultiTenant to my entity. The "Car" database table already has the TenantId column created.

"Car" Class under "Domain" project

public class Car : Entity<Guid>, IMultiTenant
{
        public string Name { get; set; }

        public Guid? TenantId { get; set; }
}

"AutoMapper" Class under "Application" project

public CarManagementApplicationAutoMapperProfile()
{
    CreateMap<Car, CarDto>();
    CreateMap<CarDto, Car>();
}

Any idea what could be wrong?

Thanks.

abp


Solution 1:[1]

It is not related with database. Object mapper is trying to map properties of Car <=> CarDto one-by-one. Check the error message carefully, it indicates which property couldn't be found.

Since you have mentioned it happens after adding IMultiTenant interface, high probably your CarDto doesn't have

public Guid? TenantId { get; set; }

property.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 gterdem