private long HandleGroupItself( long pluginId, long?parentGroupId, [NotNull] PluginSettingGroupDefinition groupDefinition) { var groupDb = _settingGroupRepository.Get(pluginId, groupDefinition.Code); if (groupDb != null) { return(groupDb.Id); } groupDb = new SettingGroups { Code = groupDefinition.Code, DisplayName = groupDefinition.DisplayName, OwnerPluginId = pluginId, ParentGroupId = parentGroupId }; _settingGroupRepository.Insert(groupDb); _settingGroupRepository.Save(); return(groupDb.Id); }