public CustomAliasRecord Create(string alias, string originalUrl, bool permanent, bool enabled)
        {
            if (GetByAlias(alias) != null)
            {
                _notifier.Warning(T("The alias {0} already exists", alias));
                return null;
            }

            CustomAliasRecord record = new CustomAliasRecord()
            {
                Alias = alias,
                OriginalUrl = originalUrl,
                Permanent = permanent,
                Enabled = enabled
            };

            _repository.Create(record);
            _customAliasConstraint.AddAlias(alias);
            return record;
        }
 public void Update(CustomAliasRecord entity)
 {
     if (!entity.Enabled)
         _customAliasConstraint.RemoveAlias(entity.Alias);
     else if(!string.IsNullOrEmpty(_customAliasConstraint.FindAlias(entity.Alias)))
         _customAliasConstraint.AddAlias(entity.Alias);
 }