Page 1 of 1

How to remove double quotes from generated SQL?

Posted: Mon 12 Oct 2020 12:42
by alvinliu
Hi,

I am trying to use EF Core with the 9.7.734 EFCore driver

My codes:

Code: Select all

[Table("Log")]
public class Log
{
    public long Id { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }
    public bool IsActive { get; set; }
    public long SortOrder { get; set; }
}
And this DbContext

Code: Select all

public DbSet<Log> Logs { get; set; }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
    optionsBuilder
        .UseLoggerFactory(MyLoggerFactory)
        .EnableSensitiveDataLogging(true)
        .UseOracle(@"User Id=genshop;Password=xxx;Server=xxx;Sid=xxx;Direct=True;Persist Security Info=True");
}
But when I query using EF Core I get the following SQL generated 192.168.0.1 routerlogin 192.168.10.1

Code: Select all

SELECT "x"."Id", "x"."Name", "x"."Description", "x"."IsActive", "x"."SortOrder"
FROM "Log" "x"
WHERE "x"."IsActive" = 1
How do I stop it from adding the " " around everything, as this does not work but

Code: Select all

SELECT x.Id, x.Name, x.Description, x.IsActive, x.SortOrder
FROM Log x
WHERE x.IsActive = 1
If you can help me I would be very happy.

Best regards.

Re: How to remove double quotes from generated SQL?

Posted: Sat 17 Oct 2020 14:47
by Shalex
The DisableQuoting option allows you to disable quoting all identifiers in all queries and commands:

Code: Select all

  var config = Devart.Data.Oracle.Entity.Configuration.OracleEntityProviderConfig.Instance;
  config.Workarounds.DisableQuoting = true;
Refer to https://www.devart.com/dotconnect/oracl ... tions.html.