0
I am able to receive the data correctly, and being able to separate them correctly too, only problem is that I do not know how to use the values and be able to write in the database, could help me ?
The image below shows how I am receiving the data and treating them until then:
[HttpPost]
public async Task<IActionResult> SellAdd(string products)
{
var objects = JsonConvert.DeserializeObject<List<object>>(products);
string[] model = objects.Select(x => x.ToString()).ToArray();
foreach (var product in model)
{
// var produtoCodigo = await _productManager.GetProductCodigoAsync();
/* var venda = new ApplicationSell
{
Quantidade = product.quantidadeProduto,
Total = product.valorTotalProduto,
ProductId = produtoCodigo.Codigo
};
await _productManager.GravaVendaAsync(venda); */
}
return RedirectToAction("Index");
}
Hello @Matheus. Avoid putting your code in images, instead edit your question and place it there.
– João Martins
have any code where you are recording something in the database? Or still have nothing related to it?
– João Martins