예제 #1
0
        public static bool CheckViewChanged(IEntitySchema entitySchema)
        {
            if (entitySchema == null)
            {
                throw new ArgumentNullException(nameof(entitySchema));
            }

            if (!DbConnectionManager.TryGet(entitySchema.ConnectKey, out DbConnectionProvider connectionProvider))
            {
                throw new KeyNotFoundException("not found DbProvider key:" + entitySchema.ConnectKey);
            }
            if (connectionProvider.AccessLevel == AccessLevel.ReadOnly)
            {
                throw new InvalidOperationException("DbProvider key:" + entitySchema.ConnectKey + ", read only!");
            }

            return(CheckViewChanged(entitySchema, connectionProvider));
        }
예제 #2
0
        public static bool CheckTableChanged(ISchemaTable table)
        {
            if (table == null)
            {
                throw new ArgumentNullException(nameof(table));
            }

            if (!DbConnectionManager.TryGet(table.Schema.ConnectKey, out DbConnectionProvider connectionProvider))
            {
                throw new KeyNotFoundException("not found DbProvider key:" + table.Schema.ConnectKey);
            }
            if (connectionProvider.AccessLevel == AccessLevel.ReadOnly)
            {
                throw new InvalidOperationException("DbProvider key:" + table.Schema.ConnectKey + ", read only!");
            }

            return(CheckTableChanged(table, connectionProvider));
        }
예제 #3
0
        public static bool CheckProcedureChanged(IEntitySchema view, ProcedureUsage usage)
        {
            if (view == null)
            {
                throw new ArgumentNullException(nameof(view));
            }

            if (!DbConnectionManager.TryGet(view.ConnectKey, out DbConnectionProvider connectionProvider))
            {
                throw new KeyNotFoundException("not found DbProvider key:" + view.ConnectKey);
            }
            if (connectionProvider.AccessLevel == AccessLevel.ReadOnly)
            {
                throw new InvalidOperationException("DbProvider key:" + view.ConnectKey + ", read only!");
            }

            return(CheckProcedureChanged(view, usage, connectionProvider));
        }