public static bool DataGetObserver(string functionality, int clientId, int countryId, int buId)
        {
            ChangeOperation subject = new ChangeOperation();
            var             entityDetachObserver = new EntityChangeObserver(clientId, countryId, buId, functionality);

            return(subject.Clone(entityDetachObserver));
        }
        public static bool DataSetObserver(string functionality, int clientId, int countryId, int buId)
        {
            ChangeOperation subject = new ChangeOperation();
            var             entityAttachObserver = new EntityChangeObserver(clientId, countryId, buId, functionality);

            if (observers.Count(n => n._clientId == entityAttachObserver._clientId && n._countryId == entityAttachObserver._countryId && n._buId == entityAttachObserver._buId && n._functionName == entityAttachObserver._functionName) == 0)
            {
                subject.Attach(entityAttachObserver);
            }
            return(true);
        }
        public bool Clone(EntityChangeObserver observer)
        {
            List <EntityChangeObserver> _observerChild = observers.Where(n => n._clientId == observer._clientId && n._countryId == observer._countryId && n._buId == observer._buId && n._functionName == observer._functionName).ToList();

            if (_observerChild.Count() >= 1)
            {
                foreach (var elem in _observerChild)
                {
                    Detach(elem);
                }
                return(true);
            }
            return(false);
        }
 public void Attach(EntityChangeObserver observer)
 {
     observers.Add(observer);
 }
 public void Update(EntityChangeObserver observer)
 {
 }
 public void Detach(EntityChangeObserver observer)
 {
     observers.Remove(observer);
 }