Пример #1
0
        public static ISchemaMerger RenameType(
            this ISchemaMerger schemaMerger,
            NameString originalTypeName,
            NameString newTypeName)
        {
            if (schemaMerger == null)
            {
                throw new ArgumentNullException(nameof(schemaMerger));
            }

            originalTypeName.EnsureNotEmpty(nameof(originalTypeName));
            newTypeName.EnsureNotEmpty(nameof(newTypeName));

            return(schemaMerger.AddTypeRewriter(
                       new RenameTypeRewriter(originalTypeName, newTypeName)));
        }
Пример #2
0
        public static ISchemaMerger IgnoreField(
            this ISchemaMerger schemaMerger,
            FieldReference field)
        {
            if (schemaMerger == null)
            {
                throw new ArgumentNullException(nameof(schemaMerger));
            }

            if (field == null)
            {
                throw new ArgumentNullException(nameof(field));
            }

            return(schemaMerger.AddTypeRewriter(
                       new RemoveFieldRewriter(field)));
        }
Пример #3
0
        public static ISchemaMerger IgnoreField(
            this ISchemaMerger schemaMerger,
            NameString schemaName,
            FieldReference field)
        {
            if (schemaMerger == null)
            {
                throw new ArgumentNullException(nameof(schemaMerger));
            }

            if (field == null)
            {
                throw new ArgumentNullException(nameof(field));
            }

            schemaName.EnsureNotEmpty(nameof(schemaName));

            return(schemaMerger.AddTypeRewriter(
                       new RemoveFieldRewriter(schemaName, field)));
        }
Пример #4
0
        public static ISchemaMerger RenameField(
            this ISchemaMerger schemaMerger,
            FieldReference field,
            NameString newFieldName)
        {
            if (schemaMerger == null)
            {
                throw new ArgumentNullException(nameof(schemaMerger));
            }

            if (field == null)
            {
                throw new ArgumentNullException(nameof(field));
            }

            newFieldName.EnsureNotEmpty(nameof(newFieldName));

            return(schemaMerger.AddTypeRewriter(
                       new RenameFieldRewriter(
                           field, newFieldName)));
        }