Another strange problem...
Curious Cat
21
Reputation points
I am entering data into a table. During this (In the OnPostAsync scope), I do send an query to an another table, to obtain a missing data that doesn't is included in the data which comes the from.
But at each try i get a strange rendered result.
It says :
Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[OtoServisWeb.Models.Stoklar]
What do I wrong ?
Below is the part where i got the issue :
public IEnumerable<Stoklar> Stoklar { get; set; } // Same result also with IList....
public async Task<IActionResult> OnPostAsync()
{
var stokkod = YedekParca.StokKod; // This value comes from the form....
var stokadi = _appDbContext.Stoklar.Where(s => s.StokKod == stokkod); // here the query....
YedekParca.StokAd = Convert.ToString(stokadi); // and with this i add to Db Table....
_appDbContext.YedekParca.Add(YedekParca);
await _appDbContext.SaveChangesAsync();
return RedirectToPage("CreateReport", new { id = YedekParca.IsId });
}
And in the DB Table i find this instead my value :
Microsoft.EntityFrameworkCore.Query.Internal.EntityQueryable`1[OtoServisWeb.Models.Stoklar