Я использую Entity Framework 5 с подходом Code First. Мне нужно прочитать возвращаемое значение из хранимой процедуры; Я уже читаю выходные параметры и отправляю входные параметры, но я не знаю, как читать возвращаемое значение.
Возможно ли это?
Вот код, который я использую для вызова хранимой процедуры:
var outParam = new SqlParameter();
outParam.ParameterName = "@StatusLog";
outParam.SqlDbType = SqlDbType.NVarChar;
outParam.Size = 4000;
outParam.Direction = ParameterDirection.Output;
var code = new SqlParameter();
code.ParameterName = "@Code";
code.Direction = ParameterDirection.Input;
code.SqlDbType = SqlDbType.VarChar;
code.Size = 20;
code.Value = "123";
var data = _context.Database.SqlQuery<Item>("exec spItemData @Code, @StatusLog OUT", code, outParam);
var result = data.FirstOrDefault();