-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
[Feature] Add 'Generate' option for the data-mapping #543
Comments
Why would you want to turn this off? The mapping is mostly required. Are you using attribute based mapping? |
I can assume a dev generates an initial version of the entities and de mappings, afterwards makes changes to the mapping and wants to prevent these changes to be overridden when regenerating. |
you can make changes anywhere outside the region, and it will be saved. public void Configure(Microsoft.EntityFrameworkCore.Metadata.Builders.EntityTypeBuilder<Core.Data.Entities.Company> builder)
{
#region Generated Configure
// table
builder.ToTable("Company", "dbo");
// key
builder.HasKey(t => t.Id);
// properties
builder.Property(t => t.Id)
.IsRequired()
.HasColumnName("Id")
.HasColumnType("int")
.ValueGeneratedOnAdd();
builder.Property(t => t.Name)
.IsRequired()
.HasColumnName("Name")
.HasColumnType("nvarchar(100)")
.HasMaxLength(100);
#endregion
// Safe to make changes here
} |
@pwelter34 if changes outside the generated region override the config above, it is indeed a solution. |
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 a 'generate' option for the mapping classes which indicates if the mappings should be generated or not.
YAML usage:
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: