private void btnLoadPriceList_Click(object sender, EventArgs e)
{
using (PriceUpdaterSQLEntities1 context = new PriceUpdaterSQLEntities1())
{
context.PRICE_LIST.RemoveRange(context.PRICE_LIST.Where(x => x.PRICE_ID != null));
context.SaveChanges();
}
}
I'm new to Entity framework and would like to know why my delete operation is not being updated to my SQL table in localDB?
I need to delete every record in the PRICE_LIST table before refilling it with new records. PRICE_ID is the PK and cannot be null, which is why I queried for not null. The code runs without errors, but nothing in the table is actually deleted. I've done a lot of reading and don't understand what I'm doing wrong here. I've rebuilt the Entity Model already, so I'm sure its not the connection string.