Repositories: Quote table and columns and use NPoco extensions over raw SQL (#20034)
* fix sql syntax issues * unify all dtos, fix autoIncrement for NPoco.Insert and .BulkInsert * fix Copilot review comments * fix sql syntax in TrackedReferencesRepository.GetPagedDescendantsInReferences() * remove changes in TemplateServiceTests * Tweaks and fixes from first review. * Reverted changes outside scope of PR. * Use FirstOrDefault over SelectTop. * Fix delete member issue. * Fixed issue with create of webhooks. * Reverted changes to default data install. * Removed unused method. * Rationalised use of quoting helpers. * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix nullability issue. --------- Co-authored-by: Andy Butland <abutland73@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -188,12 +188,12 @@ public class ContentTypeRepositorySqlClausesTest : BaseUsingSqlSyntax
|
||||
string expectedSQL =
|
||||
@"DELETE FROM [umbracoUserGroup2GranularPermission]
|
||||
WHERE (([umbracoUserGroup2GranularPermission].[uniqueId] = @0))
|
||||
AND ([umbracoUserGroup2GranularPermission].[permission] LIKE CONCAT((SELECT
|
||||
CONVERT(nvarchar(36), [cmsPropertyType].[UniqueID])
|
||||
AND ([umbracoUserGroup2GranularPermission].[permission] LIKE CONCAT(((SELECT
|
||||
CONVERT(nvarchar(36), [cmsPropertyType].[UniqueId])
|
||||
|
||||
FROM [cmsPropertyType]
|
||||
WHERE (([cmsPropertyType].[id] = @1))
|
||||
),'|%'))".Replace("\r", string.Empty);
|
||||
)),'|%'))".Replace("\r", string.Empty);
|
||||
var typedSql = sql.SQL;
|
||||
Assert.That(typedSql, Is.EqualTo(expectedSQL));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user