Skip to content

Conversation

@bdelmeire
Copy link
Contributor

This PR allows access to entity type from transform functions.
Example of use : rename all primary keys ‘TableNameId’ to ‘Id’
services.AddHandlebarsTransformers(propertyTransformer: (e, p) => $"{e.Name}Id" == p.PropertyName ? new EntityPropertyInfo(p.PropertyType, "Id", false) : new EntityPropertyInfo(p.PropertyType, p.PropertyName, p.PropertyIsNullable));

@tonysneed
Copy link
Contributor

Since this is a potentially breaking change, I'll add it to v6, which will be based on EF Core 6.

@tonysneed tonysneed added this to the v6 milestone Sep 15, 2021
@tonysneed
Copy link
Contributor

@bdelmeire I am working to merge your PR. The only change I'd like to make is to support both the old and new versions of AddHandlebarsTransformers. I'll update this PR accordingly and then merge.

@tonysneed tonysneed merged commit 6dcda7a into TrackableEntities:master Dec 5, 2021
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

Successfully merging this pull request may close these issues.

2 participants