// GET: Employees/Delete/5 //public ActionResult Delete(decimal id) //{ // if (id == null) // { // return new HttpStatusCodeResult(HttpStatusCode.BadRequest); // } // Employee employee = db.Employees.Find(id); // if (employee == null) // { // return HttpNotFound(); // } // return View(employee); //} //// POST: Employees/Delete/5 //[HttpPost, ActionName("Delete")] //[ValidateAntiForgeryToken] //public ActionResult DeleteConfirmed(decimal id) //{ // Employee employee = db.Employees.Find(id); // db.Employees.Remove(employee); // db.SaveChanges(); // return RedirectToAction("Index"); //} protected override void Dispose(bool disposing) { if (disposing) { db.Dispose(); } base.Dispose(disposing); }
protected override void Dispose(bool disposing) { //w iam commiting this beacuse this function dispose employee and leave objects, in DashBoard/Index page. //w but this is not good approach. good approch is to made a view model and pass ti to the dashboard. if (disposing) { db.Dispose(); } base.Dispose(disposing); }
protected override void Dispose(bool disposing) { if (disposing) { if (_businessContext != null) { _businessContext.Dispose(); _businessContext = null; } } base.Dispose(disposing); }
private void AddEditDayCost_OnClosing(object sender, CancelEventArgs e) { _bc.Dispose(); }
private void Window_Closing(object sender, CancelEventArgs e) { _bc.Dispose(); }
public virtual void ViewClose(object parameter) { BC.Dispose(); }