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 exists = _dataDictionaryService.Count(m => m.DicName == dicPackage.DataDictionary.DicName && m.DicValue == dicPackage.DataDictionary.DicValue); if (exists == 0) { dicPackage.DataDictionary.ID = 0; _dataDictionaryService.Add(dicPackage.DataDictionary); } } return null; }