You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our company, we use your generator for many years now with many developers. Over the years, we added some features so it works better with our solutions. As a sign of appreciation, I want to suggest some features because I think it will help some other developers as well.
Feature description:
Add an option to generate a new Guid value for the primary key property in the generated entity classes.
Feature motivation & example usage:
This allows using the primary key property before changes are saved on the dbContext.
We use the CQRS pattern with MediatR and database changes are saved automatically in the 'code pipeline'. When we have functionality which add for example a 'Project' entity, we also return the Id of the created entity to the requester (in our case we return it as a web api result). We contruct the response before database changes are done, so we already need the Id. This feature allows us to use the Id before the 'database save changes'.
Another example: when adding entities, this feature allows using the Id of the 'entities to be added' for other method calls. Sometimes we are not allowed to pass entities to other layers of the application (by architectural guidelines, seperation of concern). But the primary key value (Guid), is allowed to be passed as a value. This feature allows using the already generated value.
The option is a boolean, true enables the feature.
In our company, we use your generator for many years now with many developers. Over the years, we added some features so it works better with our solutions. As a sign of appreciation, I want to suggest some features because I think it will help some other developers as well.
Feature description:
Add an option to generate a new Guid value for the primary key property in the generated entity classes.
Feature motivation & example usage:
This allows using the primary key property before changes are saved on the dbContext.
We use the CQRS pattern with MediatR and database changes are saved automatically in the 'code pipeline'. When we have functionality which add for example a 'Project' entity, we also return the Id of the created entity to the requester (in our case we return it as a web api result). We contruct the response before database changes are done, so we already need the Id. This feature allows us to use the Id before the 'database save changes'.
Another example: when adding entities, this feature allows using the Id of the 'entities to be added' for other method calls. Sometimes we are not allowed to pass entities to other layers of the application (by architectural guidelines, seperation of concern). But the primary key value (Guid), is allowed to be passed as a value. This feature allows using the already generated value.
The option is a boolean, true enables the feature.
YAML usage:
Code generation result:
Please review the feature request and evaluate if you think this is an addition to your repo.
(pull request will be added)
Thanks
The text was updated successfully, but these errors were encountered: