I can get all the records in a table i need:
using (Entities db = new Entities())
{
db.PROJ_PLOFDataRecord.Where(x => x.Account_Id == 1);
}
I now want to remove them...cant i say something like .RemoveAll()
I can get all the records in a table i need:
using (Entities db = new Entities())
{
db.PROJ_PLOFDataRecord.Where(x => x.Account_Id == 1);
}
I now want to remove them...cant i say something like .RemoveAll()
Assuming you are in EF6, try
db.PROJ_PLOFDataRecord.Local.Clear();
db.SaveChanges();
You may need to call db.PROJ_PLOFDataRecord.Load()
first to get the Local collection populated.
Here is the documentation for .Local (MSDN)
You can do this:
yourContext.Database
.ExecuteSqlCommand("TRUNCATE TABLE <Table>");