在EF 6中,我使用此代码调用存储过程并将结果作为自定义模型返回。
var pShippingMethodId = _dataProvider.GetParameter();
pX.ParameterName = "X";
pX.Value = x;
pX.DbType = DbType.Int32;
var pStoreId = _dataProvider.GetParameter();
pY.ParameterName = "Y";
pY.Value = y;
pY.DbType = DbType.Int32;
var pLanguageId = _dataProvider.GetParameter();
pZ.ParameterName = "Z";
pZ.Value = z;
pZ.DbType = DbType.Int32;
var parameters = " @" + pX.ParameterName + ", @" + pY.ParameterName + ", @" + pZ.ParameterName;
// invoke stored procedure
var result = _dbContext.SqlQuery<AvailableDeliveryDateTimeModel>(Constants.LoadAvailableDeliveryDateTimesStoredProcedureName + parameters,pX, pY, pZ).ToList();
我想将此代码迁移到EF Core,但在EF Core中找不到合适的方法