I have just scaffolded a new database, I want to create a generic repository for crud, but the problem is; DbModels have different Unique Id variable types and names. e.g. Customer.Id, User.UserId, Company.ActuallyRandomPropertyNameId etc.
So I want to rename all of them as 'UniqueId' in DbModels and keep their table column name counterpart as they were, In code first I know 2 different methods to do it. One is giving a [Column("Id")] attribute to the Primary Key property,
the other method is using Fluent API
modelBuilder.Entity<Contact>()
.Property<int>("ContactId")
.HasColumnName("Id");
but upon my research data annotations and fluent API are both viable only for code first approach. Is there really no reliable way to this other than manually converting them one by one?