public Registration Update(Registration device)
        {
            try
            {
                if (device.isValid())
                    this._persist.Update(device);
                else
                {
                    throw new Exception(Errors.ERR_DEVICEM_MODEL_NOT_VALID);
                }
            }
            catch (Exception err)
            {
                throw new Exception(string.Format(Errors.ERR_DEVICEM_MODEL_NOT_UPDATED, device.model), err);
            }

            return device;
        }
        public Registration Create(Registration device)
        {
            try
            {
                if (device.isValid())
                    this._persist.Insert(device);
                else
                {
                    throw new Exception(Errors.ERR_DEVICEM_MODEL_NOT_VALID);
                }
            }
            catch (Exception err)
            {
                throw new Exception(Errors.ERR_DEVICEM_BAGREQUEST, err);
            }

            return device;
        }