Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Stored procedure the second time that is called does not update the data with entity framework .net core

$
0
0

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


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>