Hello, I'm a beginner in C # and MVC and am having difficulty returning a list of data. I have the code below and I do not know how to return the data loaded from the list. Can anyone suggest me how to do this? Thanks
public class EstoqueAcabadoController : Controller
{
// GET: EstoqueAcabado
public ActionResult Index()
{
using (BD context = new BD())
{
var query = from c in context.V500_ESTOQUE_ACAB select c;
foreach (var item in query)
{
ViewBag.cod_deposito = item.COD_DEPOSITO;
ViewBag.cod_reduzido = item.COD_REDUZIDO;
ViewBag.desc_cor = item.DESC_COR;
ViewBag.desc_artigo = item.DESC_ARTIGO;
ViewBag.peso_peca = item.PESO_PECA;
}
return ();
}