Long names of properties (Entity Framework)

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
msirkovsky
Posts: 3
Joined: Thu 02 Jul 2015 12:21

Long names of properties (Entity Framework)

Post by msirkovsky » Sun 17 Jun 2018 06:00

Hi I am evaluating the dotConnect for Oracle - Entity Framework and I encountered a problem with long names of class properties(resp. column names)

I have this class and table:

Code: Select all

public class TestTable {
   public Guid Id { get; set; }
   public Guid LongerNameThanEFCanHandle1234567
}
I call:

Code: Select all

Db dbContext = CreateDbContext();
dbContext.Set<TestTable>.Load();
The query that EF generates:

Code: Select all

SELECT 
Extent1.ID,
Extent1.R1,
FROM TESTTABLE Extent1
Column "LongerNameThanEFCanHandle1234567" is named as R1.

Is there some limitation for length of column?

Thank you

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Long names of properties (Entity Framework)

Post by Shalex » Tue 19 Jun 2018 17:23

The names of columns are generated by EF engine basing on class properties names.
Be aware that EF6 allows to set custom conventions via OnModelCreating (like the one described at https://www.devart.com/dotconnect/oracl ... olean.html) where you could specify the column name basing on your algorithm.
msirkovsky wrote: Sun 17 Jun 2018 06:00Is there some limitation for length of column?
Yes, there is: 128 symbols in Oracle 12R2 and 30 symbols in Oracle 12R1 and below.

Post Reply