1
I have records in the database (example, clients), and in all records have an identifier EmpresaID
. I’m using identity
with Entity framework to authenticate. In the user’s registration I have an identifier "Empresaid".
I wonder how do I bring only the records that the EmpresaId
the customer is equal to EmpresaId
user in the code below:
public ActionResult Index()
{
Empresa empresa = new Empresa();
RegisterViewModel usuario = new RegisterViewModel();
var exames = db.Exames.Include(p => p.Empresa);
return View(db.Exames.ToList());
}
Currently brings all the records:
public ActionResult Index()
{
Empresa empresa = new Empresa();
RegisterViewModel usuario = new RegisterViewModel();
var exames = db.Exames.Include(p => p.Empresa);
return View(db.Exames.ToList());
}