Hello guys,
I've downloaded the framework with VisualStudio Core MVC, and I've changed the database settings to be compatible for PostgreSQL. I'm trying to create new screens on my existing tables which I've already been using.
I've just realized that the framework requires two mandatory columns such as "Id" and "TenantId" on tables. The problem is that I've already been using the "id" column as primary key on my existing tables. PostgreSQL is case sensitive when creating columns, so the boilerplate does not recognize the column "id" in lowercase because it requires upper case for the first letter. On the other hand, I can not change the "id" column to uppercase since the table is being used by other services.
I need to change the framework's mandatory column "Id" to "id" to be able to handle that case. I think, that column comes from the abstract "Entity" class. Is there any way to change it?
Thanks in advance.
3 Answer(s)
-
0
The case of Entity cannot be changed, but you can configure the ColumnName of the EF Core database. for example:
modelBuilder.Entity<User>().Property(x => x.Id).HasColumnName("id");
-
0
That worked.
Thanks!