public bool UpdateRoleItem(RoleItem item) { if (_roleItems.ContainsKey(item.Id)) { _roleItems[item.Id] = item.Clone(); } else { throw new Exception("Item does not exist."); } return(true); }
public RoleItem GetRoleItem(int id) { RoleItem item = null; if (_roleItems.ContainsKey(id)) { item = _roleItems[id]; } else { throw new Exception("Item does not exist."); } return(item.Clone()); }
public int AddRoleItem(RoleItem item) { _roleItems.Add(item.Id, item.Clone()); return(item.Id); }