Hi,
I have a service class that use a entity framwork for call a strored procedure with "FromSqlRaw" method.
All work fine a first time, but in second time doesn't work the chipsReport array it is not update with new result.
The parameters that I pass change
This is my method with stored procedure.
ChipReport[] chipsReport; public async Task<ChipReport[]> GetChipsReportsAsync(DateTime gamingDate, int valueTypeId, int absolute) { var param = new SqlParameter[] { new SqlParameter() {ParameterName = "@gaming", SqlDbType = System.Data.SqlDbType.DateTime, Direction = System.Data.ParameterDirection.Input, Value = gamingDate }, new SqlParameter() {ParameterName = "@valuetypeid", SqlDbType = System.Data.SqlDbType.Int, Direction = System.Data.ParameterDirection.Input, Value = valueTypeId }, new SqlParameter() {ParameterName = "@absolute", SqlDbType = System.Data.SqlDbType.Int, Direction = System.Data.ParameterDirection.Input, Value = absolute} }; chipsReport = _context .chipsReports .FromSqlRaw("EXEC [Accounting].[usp_ChipsReportEx] @gaming, @valuetypeid, @absolute", param) .ToArray(); await Task.Yield(); return chipsReport; }Can anyone help me?
BR