How to remove double quotes from generated SQL?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
alvinliu
Posts: 1
Joined: Mon 12 Oct 2020 12:35

How to remove double quotes from generated SQL?

Post by alvinliu » Mon 12 Oct 2020 12:42

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.
Last edited by alvinliu on Tue 27 Oct 2020 09:04, edited 1 time in total.

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

Re: How to remove double quotes from generated SQL?

Post by Shalex » Sat 17 Oct 2020 14:47

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.

Post Reply