I have Using Entity Framework Core in my Project. There I am passing the parameters to the Stored Procedure. When i am passing the null value for any parameter it is giving it is not returning any List of data.
But I have Used Same Code for another stored Procedure which has only one parameter of “ID” then it is Returned List Correctly.
I have Written the Following Code in DbContext Class
public virtual DbSet<GetBillsByLabId_Result> GetBillsByLabId_Result { get; set; }
public void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<GetBillsByLabId_Result>(entity =>
entity.HasNoKey());
}
public IEnumerable<GetBillsByLabId_Result> SP_GetEmployeesWithDepartment(Nullable<long> labId, Nullable<long> labLocationId, string recordStatus, Nullable<bool> showPresentDayBills, Nullable<long> incomingLabId, Nullable<long> referralCompanyId)
{
return this.GetBillsByLabId_Result
.FromSqlInterpolated($"[MED].[GetBillsByLabId] {labId}, {labLocationId}, {recordStatus}, {showPresentDayBills}, {incomingLabId}, {referralCompanyId}")
.ToArray();
}
And The below Code is Witten in Controller As You can See in the Visualizer ididnot get the Any data here Why?