Repository navigation
Add typed DTO selection, updates and deletes - #206
Open
jogibear9988 wants to merge 5 commits into
Open
jogibear9988 wants to merge 5 commits into
jogibear9988 wants to merge 5 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add migration-local typed DTO selection, updates and deletes with parameterized SQL and normal predicate lambdas. String predicates support
Contains(string),StartsWith(string)andEndsWith(string).Public API
Extension methods in
DotNetProjects.Migrator.Framework:The table name is explicit. Selection returns materialized DTOs; mutations return the driver-reported affected row count.
DTO mapping
Properties map to columns by name; standard
ColumnAttributeoverrides names. The alias avoids Migrator's existingColumnAttributeenum. Inherited public properties are supported; standardNotMappedAttributeexcludes properties. DTOs need a public parameterless constructor and public readable/writable scalar properties.Usage: select, string filtering, update and delete
Assuming
provideris the migration'sITransformationProvider:Inside a Classic migration use
Database.Select<T>,Database.Update<T>andDatabase.Delete<T>. In aFluentMigration, use the correspondingContextmethods for immediate operations; these cannot see schema changes merely queued in the same builder.Behavior and limits
&&,||,!, grouping, null checks, constants and captured scalar fields are translated into SQL; there is no implicit client-side filtering.%,_, the escape character, and SQL Server/Sybase bracket wildcards are treated literally. Character andStringComparisonoverloads are unsupported.Part 1 of the implementation for #202. The SQL interpolation proposal is implemented separately in #208. Merge this PR first, then retarget #208 to master.
Validation:
Generated documentation includes renumbered example IDs after adding the original DTO sample.