This code uses a temporary table
namespace Nop.Plugin.Group.Name.Domain
{
public class SearchResult : BaseEntity
{
public int ProductId { get; set; }
}
}
Then In ContextObject.cs make the temporary table
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<SearchResult>();
base.OnModelCreating(modelBuilder);
}
Then in controller some code to call the procedure and receive the results as records
var query = "SET DATEFORMAT mdy EXEC GetAssociatedProductByDate @StartDate= '" +
cevent.RelatedDate.ToString("MM/dd/yyyy", CultureInfo.InvariantCulture) + "',@ParentGroupedProductId= " +
model.GroupedProductId;
var records = _ContextObject.Set<SearchResult>().FromSql(query).ToList();