For my website, I am able to display every detail of the Account Table in my database. My AccountStatus has 2 values inside the database; "Approved" and "Rejected". However, I want to display the details on my website only if the value of the AccountStatus is "Approved".
I am currently using ASP.net core MVC with EF core and SQL server.
Model:
public class AccountModel
{
[Key]
public Guid AccountID { get; set; }
public DateTime AccountCreationDateTime { get; set; }
public string AccountStatus { get; set; }
}
Controller:
public async Task<IActionResult> Account()
{
return View(await _context.Account.ToListAsync());
}