Skip to content

How to remove the default "Id" Identifier in _defaultIdMemberNames ? #234

@olivier-romero

Description

@olivier-romero

We had a error if we don't remove "Id" in _defaultIdMemberNames source code.
By default => Mapper created a wrong plan with some Id.
the created plan =>

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Map TiersProductUI -> TiersProduct
// Rule Set: CreateNew
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
tpuiToTpData =>
{
try
{
var tiersProduct = new TiersProduct();
tiersProduct.Id = tpuiToTpData.Source.ProductId;
tiersProduct.TiersID = tpuiToTpData.Source.TiersId;
tiersProduct.ProductID = tpuiToTpData.Source.ProductId;
// Tiers is ignored by filter:
// !m.HasAttribute()
// Product is ignored by filter:
// !m.HasAttribute()
// LastModifiedOn is ignored by filter:
// !m.HasAttribute()
Action<TiersProductUI, TiersProduct>.Invoke(tpuiToTpData.Source, tiersProduct);

    return tiersProduct;
}
catch (Exception ex)
{
    throw MappingException.For(
        "CreateNew",
        "TiersProductUI",
        "TiersProduct",
        ex);
}

}

it had to be tiersProduct.Id = tpuiToTpData.Source.Id;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions