I want to use entity framework core to get data from database instead of using sql request like in this exemple :
SELECT INT_To_STR(CODE), LIBELLE FROM TABLE2
will be replaced by :
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseOracle(ConnectionString);
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Ccy>(entity =>
{
entity.ToTable("Table2");
entity.HasKey(e => e.Code);
entity.Property(e => e.Code).HasColumnName("CODE");
entity.Property(e => e.Name).HasColumnName("LIBELLE");
});
}
the problem that i am facing is that i want to use the function 'INT_To_STR' Is there any solution? Thanks.
Please have a look on query types. With their help you can call user-defined functions in your database like this:
context.[QUERYTYPE].FromSql("SELECT [FUNCTIONNAME] ...")