public override Package Pack(object obj)
        {
            DataDictionaryPackage package = null;

            if (OnPacking != null)
            {
                package = base.Pack(OnPacking()) as DataDictionaryPackage;
            }
            if (package == null)
            {
                package = CreatePackage() as DataDictionaryPackage;
            }
            package.DataDictionary = obj as DataDictionaryEntity;
            return(package);
        }
        public override object Install(Package package)
        {
            base.Install(package);
            DataDictionaryPackage dicPackage = package as DataDictionaryPackage;

            if (dicPackage != null)
            {
                var dataDictionaryService = ServiceLocator.Current.GetInstance <IDataDictionaryService>();
                var exists = dataDictionaryService.Count(new DataFilter().Where("DicName", OperatorType.Equal, dicPackage.DataDictionary.DicName).Where("DicValue", OperatorType.Equal, dicPackage.DataDictionary.DicValue));
                if (exists == 0)
                {
                    dataDictionaryService.Add(dicPackage.DataDictionary);
                }
            }

            return(null);
        }