public class CompanyUpdateRequest
{
public int Id { get; set; }
public List<ApiUpdateRequest> AssignedApis { get; set; }
// Other properties...
}
public class ApiUpdateRequest
{
public int Id { get; set; }
public string ApiKey { get; set; }
// Other properties...
}
And here is an entity called Api
public class Api: BaseEntity
{
public string ApiKey { get; set; } = null!;
// Other properties...
}
in my mapping profil i've added the following
CreateMap<CompanyUpdateRequest, Company>()
.ForMember(dest => dest.AssignedApis, opt => opt
.MapFrom(src => src.AssignedApis));
CreateMap<ApiUpdateRequest, Api>()
.ForMember(dest => dest.ApiKey, opt => opt.Ignore()); // Ignore mapping apiKey
public class CompanyUpdateRequest
{
public int Id { get; set; }
public List<ApiUpdateRequest> AssignedApis { get; set; }
// Other properties...
}
public class ApiUpdateRequest
{
public int Id { get; set; }
public string ApiKey { get; set; }
// Other properties...
}
And here is an entity called Api
public class Api: BaseEntity
{
public string ApiKey { get; set; } = null!;
// Other properties...
}
in my mapping profil i've added the following
CreateMap<CompanyUpdateRequest, Company>()
.ForMember(dest => dest.AssignedApis, opt => opt
.MapFrom(src => src.AssignedApis));
CreateMap<ApiUpdateRequest, Api>()
.ForMember(dest => dest.ApiKey, opt => opt.Ignore()); // Ignore mapping apiKey