I have a PRODUCT registration form and there is a relationship with the SUPPLIER table, as shown in the image below:
ClickingtheSEARCHPROVIDERbuttonwilldisplaythisView
Now I need to develop a text box that when typing a value it looks for all SUPPLIERS that contains a FANTASY NAME equal to the one typed in the text box.
This Controller shows all the providers, but I only want the ones with FANTASY NAME typed in the text box:
public ActionResult Index()
{
try
{
using (SistemaDBEntities db = new SistemaDBEntities())
{
return View(db.Fornecedor.Where(s => s.Ativo == true).ToList());
}
}
catch (Exception)
{
throw;
}
}