Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
olivier-romero opened this issue Jun 14, 2023 · 0 comments
Open

Comments

@olivier-romero
Copy link

olivier-romero commented Jun 14, 2023

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant