public IActionResult Update(string emailUser, [FromBody] EmailEntry emailEntry)
        {
            IEmailEntry existingItem = _emailDatabase.Find(emailUser);

            if (existingItem == null)
            {
                return(NotFound());
            }

            bool        updated         = false;
            IEmailEntry proxyEmailEntry = new ProxyEmailEntry(existingItem);

            foreach (PropertyInfo info in emailEntry.GetType().GetProperties())
            {
                object newValue = info.GetValue(emailEntry);
                if (newValue != null)
                {
                    info.SetValue(proxyEmailEntry, newValue);
                    updated = true;
                }
            }

            if (updated)
            {
                _emailDatabase.Update(existingItem);
            }

            return(new ObjectResult(existingItem)
            {
                StatusCode = StatusCodes.Status200OK,
            });
        }
        public IActionResult Create([FromBody] EmailEntry emailEntry)
        {
            IEmailEntry existingItem = _emailDatabase.Find(emailEntry.EmailUser);

            if (existingItem == null)
            {
                _emailDatabase.Insert(emailEntry);
                return(new ObjectResult(emailEntry)
                {
                    StatusCode = StatusCodes.Status201Created
                });
            }
            else
            {
                return(Conflict());
            }
        }