Beispiel #1
0
        public override Exceptional Set(DBContext context, TypesSettingScope scope, GraphDBType type = null, TypeAttribute attribute = null)
        {
            switch (scope)
            {
                case TypesSettingScope.DB:
                    #region db

                    return context.DBSettingsManager.SetPersistentDBSetting(context, this);

                    #endregion

                case TypesSettingScope.SESSION:
                    #region session

                    return context.SessionSettings.SetSessionSetting(this);

                    #endregion

                case TypesSettingScope.TYPE:
                    #region type

                    if (type != null)
                    {
                        return type.SetPersistentSetting(this.Name, this, context.DBTypeManager);
                    }

                    return new Exceptional(new Error_CouldNotSetSetting(this, scope));

                    #endregion

                case TypesSettingScope.ATTRIBUTE:
                    #region attribute

                    if ((type != null) && (attribute != null))
                    {
                        return attribute.SetPersistentSetting(this.Name, this, context.DBTypeManager);
                    }

                    return new Exceptional(new Error_CouldNotSetSetting(this, scope, type, attribute));
                    #endregion

                default:

                    return new Exceptional(new Error_NotImplemented(new System.Diagnostics.StackTrace()));
            }
        }