Remove nullable annotation from stored procedure List return types#3294
Draft
Remove nullable annotation from stored procedure List return types#3294
Conversation
…m List return types - Added GenerateEmptyResultType configuration option to CLI and VS options - Updated DbContextExtensions template to remove property count check and simplify implementation - Removed nullable annotation from List<T> return types in stored procedure scaffolders - Updated ProcedureScaffolder to only generate empty result classes when GenerateEmptyResultType is enabled - Improved error messages in SqlServerRoutineModelFactory with actionable suggestions - Updated JSON schema with new configuration option Co-authored-by: ErikEJ <4169187+ErikEJ@users.noreply.github.com>
…ionality - Updated CliConfigMapperTest to expect 56 properties (added GenerateEmptyResultType) - Verified end-to-end CLI tool functionality with NorthwindProcedures.dacpac - Confirmed generated stored procedures return non-nullable List<T> instead of List<T>? - Confirmed DbContextExtensions uses simplified implementation without property count check - All 78 tests pass successfully Co-authored-by: ErikEJ <4169187+ErikEJ@users.noreply.github.com>
- Changed CancellationToken? to CancellationToken (non-nullable value type) - Removed unnecessary null-coalescing for CancellationToken - Removed .Value access on CancellationToken - Updated both SqlServerStoredProcedureScaffolder and PostgresStoredProcedureScaffolder - Updated DbContextExtensions template - All tests still pass - End-to-end validation successful Co-authored-by: ErikEJ <4169187+ErikEJ@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add option for non-nullable return from stored procedures
Remove nullable annotation from stored procedure List return types
Jan 25, 2026
Owner
|
@copilot The new config option should apply on procedure level, not generally |
Owner
|
@copilot Update vsix.yaml from |
- Removed GenerateEmptyResultType from global CodeGeneration config - Added GenerateEmptyResultType to per-procedure StoredProcedure configuration - Added ModulesGeneratingEmptyResultTypes dictionary to ModuleModelFactoryOptions - Added GenerateEmptyResultType property to Routine class - Updated SqlServerRoutineModelFactory to set per-procedure flag from config - Updated ProcedureScaffolder to check per-routine flag instead of global option - Updated SerializationTableModel to include GenerateEmptyResultType property - Updated CliConfigMapper to map per-procedure settings - Updated ReverseEngineerScaffolder to build ModulesGeneratingEmptyResultTypes dictionary - Updated JSON schema to show option at procedure level - Updated tests to reflect property count changes - All 78 tests pass Co-authored-by: ErikEJ <4169187+ErikEJ@users.noreply.github.com>
Contributor
Author
The addition of new files (GenerateEmptyResultType property and related changes) increased the file count in the efreveng100 build output from 139 to 141 files. Co-authored-by: ErikEJ <4169187+ErikEJ@users.noreply.github.com>
Contributor
Author
Updated vsix.yml to check for 141 files instead of 139 in efreveng100.exe.zip. The file count increased due to the new files added for the per-procedure GenerateEmptyResultType feature. Commit e3f5c07 |
Owner
|
@copilot Remove trailing whitespaces in CliConfigMapper to resolve the build issue |
Removed trailing whitespaces on lines 355 and 363 to resolve build/lint issues. Co-authored-by: ErikEJ <4169187+ErikEJ@users.noreply.github.com>
Contributor
Author
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.
Implementation Plan for Non-Nullable Stored Procedure Result Sets
Understanding
When nullable reference types are enabled, stored procedures currently return
Task<List<T>?>(nullable list). The issue is that:default(null)Changes Required
GenerateEmptyResultType(bool) - Now per-procedure instead of globalDbContextExtensionstemplate to remove property count check and simplify implementation?) fromList<T>return types when nullable references are enabledGenerateEmptyResultTypeis true for that specific procedureKey Files Modified
StoredProcedure.cs(added per-procedure option),CodeGeneration.cs(removed global option),CliConfigMapper.cs,efcpt-config.schema.json,ReverseEngineerCommandOptions.cs,ReverseEngineerOptions.cssrc/Core/RevEng.Core.80/DbContextExtensionsSqlQuerySqlServerStoredProcedureScaffolder.cs,PostgresStoredProcedureScaffolder.cs,ProcedureScaffolder.csModuleModelFactoryOptions.cs(added dictionary),ModuleScaffolderOptions.cs(removed global),ReverseEngineerScaffolder.csRoutine.cs(added per-routine property),SqlServerRoutineModelFactory.csSerializationTableModel.cs(added property)SqlServerRoutineModelFactory.csCliConfigMapperTest.cs.github/workflows/vsix.yml(updated file count check)Configuration Example
{ "stored-procedures": [ { "name": "[dbo].[MyProcedure]", "generate-empty-result-type": true } ] }Verified Results
✅ Generated stored procedures return
Task<List<T>>instead ofTask<List<T>?>✅ CancellationToken is non-nullable (not
CancellationToken?)✅ DbContextExtensions simplified - no longer checks property count
✅ All existing tests pass (78 passed, 4 skipped)
✅ GenerateEmptyResultType is now configured per stored procedure
✅ Code review feedback addressed
✅ Build fixed with correct file count
✅ Trailing whitespaces removed
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.