Question

How can I select all values in my table.

So I have table CustomerTables with this atributes:

IdCust; (int - PK) UserId; (int - FK) Customer; (string)

I start with this code:

public ActionResult DeleteConfirmed(int id)
{
  using (var dbContext = new userDbEntities())
  {
  var deleteCust = dbContext.CustomerTables.Where(m => m.UserId == id).Select(m => m.???); 
  }
}

So how to in .Select(m => m.???) select all values in Table CustomerTable?

Thanks for any ideas.

Was it helpful?

Solution

You can omit the Select() and you'll get a collection of CustomerTable objects. Assuming your CustomerTable model contains all values from the table and they are properly mapped, you should have access to all values...

var deleteCust = dbContext.CustomerTables.Where(m => m.UserId == id);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top