Search code examples
asp.net-coreasp.net-core-mvc

I need to pass the id for the summary and fetch the data of the particular person


Here is the summary code in ASP.NET Core:

public IActionResult Index()
{
     List<Order> order = _db.Order.GetAll().ToList();
     return View(order);
}

In this code, I need to get the summary based on the user raised records.

I need to fetch the data based on the id who raised the data or a records


Solution

  • You can use DbContext.Find Method to get a specific record from the database.

    https://learn.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbcontext.find?view=efcore-8.0