//GET MENU_ROLE MAX ID public int GetMax() { using (ALSIEntities ctx = new ALSIEntities()) { m_role mRole = (from c in ctx.m_role select c).OrderByDescending(x => x.ID).FirstOrDefault(); if (mRole != null) { return((int)mRole.ID + 1); } return(-1); } }
public void Update() { m_role existing = _repository.Find(x => x.ID == this.ID).FirstOrDefault(); _repository.Edit(existing, this); }