EntityFrameWork를 사용하여 Delete하기
using (clscEntities context = new clscEntities()) { foreach (var item in input) { tcl_process_category_study model = new tcl_process_category_study { category_no = item.CategoryNo, company_seq = companySeq, study_cd = item.ProcessCd, study_type = item.StudyType }; context.tcl_process_category_study.Attach(model); context.ObjectStateManager.ChangeObjectState(model, EntityState.Deleted); } context.SaveChanges(); }
Entity Framework