How to solve this situation?
Example:
Please, consider the following model:
Code: Select all
namespace OracleDevartDriverTest
{
public class Genero
{
public string CodigoGenero { get; set; }
}
public class Amigo
{
public int Id { get; set; }
public string Nome { get; set; }
public string FK_CodigoGenero { get; set; }
}
}
Code: Select all
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Entity<Amigo>()
.ToTable("AMIGO")
.HasKey(t => t.Id);
modelBuilder.Entity<Amigo>()
.Property(m => m.Id)
.HasColumnName("ID");
modelBuilder.Entity<Amigo>()
.Property(m => m.Nome)
.HasColumnName("NOME");
modelBuilder.Entity<Amigo>()
.Property(m => m.FK_CodigoGenero)
.HasColumnName("FK_NM_GENERO");
// ----
modelBuilder.Entity<Genero>()
.ToTable("GENERO")
.HasKey(t => t.CodigoGenero);
modelBuilder.Entity<Genero>()
.Property(m => m.CodigoGenero)
.HasColumnName("NM_GENERO");
}
Code: Select all
var amigo = (from Genero a in ctx.Generos
join Amigo g in ctx.Amigos on a.CodigoGenero equals g.FK_CodigoGenero into h
select new
{
Nome = a.CodigoGenero,
Numero = h.OrderByDescending(n => n.Nome).FirstOrDefault()
}
).ToList();
The same happens to the official Oracle Database Privider for .NET (ODP).OUTER APPLY is not supported by Oracle Database 11g and lower. Oracle 12c or higher is required to run this LINQ statement correctly. If you need to run this statement with Oracle Database 11g or lower, rewrite it so that it can be converted to SQL, supported by the version of Oracle you use.
How to tell the provider that I'm using Oracle 11g and not Oracle 12c???!!
I think it should do it automatically, but it doesn't do!