It's not running on Azure..
The code and database are on local server
I had to choose tags as it's mandatory to post a question and no tags for .net,efCore available.
I would be thankful to you for Kindly redirect to the right forum.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I am not able retrieve data from Oracle View in using ORacle Entity Framework Core and .Net EF core 3.0, but tables are returning data.
The Context.<ViewName>.ToList() is always showing 0 result with no errors.
the Model is generated using Scaffold-DbContext with Oracle DB connection
Code Sample:
Model Context
public virtual DbSet<XxegcXerpSalesmanMasterV> XxegcXerpSalesmanMasterV { get; set; }
modelBuilder.Entity<XxegcXerpSalesmanMasterV>(entity => { entity.HasNoKey(); entity.ToView("XXEGC_XERP_SALESMAN_MASTER_V", "APPS"); entity.Property(e => e.CreationDate) .HasColumnName("CREATION_DATE") .HasColumnType("DATE"); entity.Property(e => e.Division) .HasColumnName("DIVISION") .HasMaxLength(150) .IsUnicode(false); entity.Property(e => e.EndDateActive) .HasColumnName("END_DATE_ACTIVE") .HasColumnType("DATE"); entity.Property(e => e.LastUpdateDate) .HasColumnName("LAST_UPDATE_DATE") .HasColumnType("DATE"); entity.Property(e => e.MainWhCode) .HasColumnName("MAIN_WH_CODE") .HasMaxLength(3) .IsUnicode(false); entity.Property(e => e.MainWhName) .HasColumnName("MAIN_WH_NAME") .HasMaxLength(240) .IsUnicode(false); entity.Property(e => e.OrgId) .HasColumnName("ORG_ID") .HasColumnType("NUMBER"); entity.Property(e => e.ResourceId) .HasColumnName("RESOURCE_ID") .HasColumnType("NUMBER"); entity.Property(e => e.ResourceStatus) .HasColumnName("RESOURCE_STATUS") .HasColumnType("CHAR(1)"); entity.Property(e => e.RouteCode) .HasColumnName("ROUTE_CODE") .HasMaxLength(16) .IsUnicode(false); entity.Property(e => e.RouteType) .HasColumnName("ROUTE_TYPE") .HasMaxLength(150) .IsUnicode(false); entity.Property(e => e.SalesmanName) .HasColumnName("SALESMAN_NAME") .HasMaxLength(1412) .IsUnicode(false); entity.Property(e => e.SalesmanNumber) .HasColumnName("SALESMAN_NUMBER") .HasMaxLength(30) .IsUnicode(false); entity.Property(e => e.SalesrepId) .HasColumnName("SALESREP_ID") .HasColumnType("NUMBER"); entity.Property(e => e.StartDateActive) .HasColumnName("START_DATE_ACTIVE") .HasColumnType("DATE"); entity.Property(e => e.VanSubinv) .HasColumnName("VAN_SUBINV") .HasMaxLength(30) .IsUnicode(false); });
Class Defination
namespace MVC_oracle.Models { public partial class XxegcXerpSalesmanMasterV { public decimal ResourceId { get; set; } public string SalesmanName { get; set; } public string SalesmanNumber { get; set; } public string RouteCode { get; set; } public string RouteType { get; set; } public string VanSubinv { get; set; } public string MainWhCode { get; set; } public decimal? OrgId { get; set; } public string Division { get; set; } public decimal SalesrepId { get; set; } public string ResourceStatus { get; set; } public DateTime? CreationDate { get; set; } public DateTime? LastUpdateDate { get; set; } public DateTime StartDateActive { get; set; } public DateTime? EndDateActive { get; set; } public string MainWhName { get; set; } } }
Controller Class:
private readonly ModelContext _context;
var SalesMans = _context.XxegcXerpSalesmanMasterV.ToList(); // Not getting data here
It's not running on Azure..
The code and database are on local server
I had to choose tags as it's mandatory to post a question and no tags for .net,efCore available.
I would be thankful to you for Kindly redirect to the right forum.
Hi HirneshJain-6903,
Thanks for taking time to report this problem with us. I found a similar issue, maybe it could help you.
And since your issue is more related to database development. We suggest you could redirect to stack overflow with entity-framework tag, where you will get better support about it.
Best Regards,
Dylan