public void InsertList(List <tb_m_detail_spec> _lists) { foreach (tb_m_detail_spec tmp in _lists) { switch (tmp.RowState) { case CommandNameEnum.Add: _repository.Add(tmp); break; case CommandNameEnum.Edit: tb_m_detail_spec existing = _repository.Find(x => x.ID == tmp.ID).FirstOrDefault(); _repository.Edit(existing, tmp); break; } } }
public void Update() { tb_m_detail_spec existing = _repository.Find(x => x.ID == this.ID).FirstOrDefault(); _repository.Edit(existing, this); }