public int AddCustomerApiKey(Model.CustomerApiKey customerApiKeyModel)
        {
            if (string.IsNullOrEmpty(customerApiKeyModel.ApiKey))
            {
                throw new ArgumentException($"Apikey value is null or empty");
            }

            CustomerApiKey customerApiKey = customerApiKeyModel.MapFull();

            _context.CustomerApiKey.Add(customerApiKey);
            _context.Save();

            return(customerApiKey.Id);
        }
        public int UpdateCustomerApiKey(Model.CustomerApiKey customerApiKeyModel)
        {
            if (customerApiKeyModel.Id == 0)
            {
                throw new ArgumentException($"Id is not valid");
            }

            CustomerApiKey customerApiKey = _context.CustomerApiKey.SingleOrDefault(x => x.Id.Equals(customerApiKeyModel.Id));

            if (customerApiKey == null)
            {
                throw new ArgumentException($"No data found with id: {customerApiKeyModel.Id}");
            }

            customerApiKeyModel.MapFull(customerApiKey);

            _context.Save();
            return(customerApiKey.Id);
        }