[CreateMultiLingualMap] Id of the entity is replaced by the id of the translation in the mapping
See original GitHub issueProblem (using the documentation example)
While using the new (awesome and much anticipated btw) Multi Lingual Entities feature, i needed to get the id of the product with the translated name in the ProductListDto
class.
public class ProductListDto: EntityDto
{
// Mapped from Product.Price
public decimal Price { get; set; }
// Mapped from ProductTranslation.Name
public string Name { get; set; }
}
I’m getting the correct translation for name but the Id (from EntityDto
) is getting the ProductTranslation
Id not the Product
one (using CoreId
as a property does the Job of getting the correct one instead)
Suggestion
If i understand correctly, in the CreateMultiLingualMap extention, in the aftermap, we check if there is a Translation so we map it and at the same time it replace the id.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Multi-Lingual Entities
This extension method finds the translation with selected UI language first. ... CreateMultiLingualMap also allows you to define type of the id field...
Read more >Projection or Custom Value Resolvers with new Multi ...
If I put the Projection or Resolver after the CreateMultiLingualMap then the ItemCount maps correctly but the CatalogItemName fails to map. How ...
Read more >Update existing 'node' entity while changing the ID is not ...
Try to sort the view result in a way that makes the translated entity appears after the original one. Proposed resolution. I attached...
Read more >How to Design Multi-Lingual Entity - ABP Community
We don't need to change anything in the UI, if there is a translation according to the language chosen by the user, the...
Read more >Entity Links fields does not have translation support
The Entity link field uses the wrong translation of the entity. It always uses the original language which is not always desired. This...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@valleen I think I have found the issue but this is an EF Core problem. When you clear the Translations while you are updating your entity, it is not removed from database and probably still exist in the change tracking. So, if you change your update method like this, it will work.
@valleen sure.