Skip to content

Add missing value types to EfAnalysisConstants#17

Merged
HandyS11 merged 2 commits intorefacto/ImproveCodeQualityfrom
copilot/sub-pr-12-one-more-time
Feb 3, 2026
Merged

Add missing value types to EfAnalysisConstants#17
HandyS11 merged 2 commits intorefacto/ImproveCodeQualityfrom
copilot/sub-pr-12-one-more-time

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

The ValueTypes HashSet was missing common .NET value types (byte, sbyte, ushort, uint, ulong, char), causing incomplete type detection when semantic analysis is unavailable.

Changes:

  • Added constant definitions for missing integral and character types
  • Included both C# keyword aliases (byte, uint) and .NET type names (Byte, UInt32) following existing patterns
  • Extended ValueTypes HashSet with all missing types

This ensures IsEfValueType() correctly identifies all .NET value types used in Entity Framework models.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: HandyS11 <62420910+HandyS11@users.noreply.github.com>
Copilot AI changed the title [WIP] Work in progress for code quality improvements based on PR #12 Add missing value types to EfAnalysisConstants Feb 3, 2026
Copilot AI requested a review from HandyS11 February 3, 2026 15:03
@HandyS11 HandyS11 marked this pull request as ready for review February 3, 2026 15:04
Copilot AI review requested due to automatic review settings February 3, 2026 15:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses incomplete type detection in Entity Framework analysis by adding missing .NET value types to EfAnalysisConstants. The change ensures that IsEfValueType() correctly identifies all common .NET value types when semantic analysis is unavailable.

Changes:

  • Added constant definitions for byte, sbyte, ushort, uint, ulong, and char types
  • Extended the ValueTypes HashSet to include these newly defined constants

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

public const string Long = "long";
public const string Single = "Single";
public const string Short = "short";
public const string Byte = "byte";
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing .NET type name constant for Byte. Following the existing pattern (e.g., Int and Int32, Bool and Boolean), there should be a constant named Byte with value "Byte" to represent the .NET BCL type name, in addition to the lowercase byte keyword alias.

Copilot uses AI. Check for mistakes.
public const string Single = "Single";
public const string Short = "short";
public const string Byte = "byte";
public const string SByte = "sbyte";
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing .NET type name constant for SByte. Following the existing pattern (e.g., Int and Int32, Bool and Boolean), there should be a constant named SByte with value "SByte" to represent the .NET BCL type name, in addition to the lowercase sbyte keyword alias. This is necessary for proper type detection when the type is referenced by its .NET name.

Copilot uses AI. Check for mistakes.
public const string Short = "short";
public const string Byte = "byte";
public const string SByte = "sbyte";
public const string UShort = "ushort";
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing UInt16 constant for the .NET BCL type name. The unsigned short type has the .NET name UInt16, not UShort. Following the existing pattern (e.g., Long/Int64, UInt/UInt32), there should be both UShort with value "ushort" (the C# keyword) and UInt16 with value "UInt16" (the .NET type name).

Copilot uses AI. Check for mistakes.
public const string UInt32 = "UInt32";
public const string ULong = "ulong";
public const string UInt64 = "UInt64";
public const string Char = "char";
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing .NET type name constant for Char. Following the existing pattern (e.g., Int and Int32, Bool and Boolean), there should be a constant named Char with value "Char" to represent the .NET BCL type name, in addition to the lowercase char keyword alias.

Copilot uses AI. Check for mistakes.
Comment on lines +58 to +65
Byte,
SByte,
UShort,
UInt,
UInt32,
ULong,
UInt64,
Char
Copy link

Copilot AI Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ValueTypes HashSet is missing the .NET BCL type name equivalents for the newly added types. Following the existing pattern where both C# keyword aliases and .NET type names are included (e.g., Int and Int32, Bool and Boolean), the following should be added after defining the missing constants: a reference to Byte (for "Byte"), a reference to SByte (for "SByte"), a reference to UInt16 (for "UInt16"), and a reference to Char (for "Char"). This ensures proper type detection regardless of whether the type is referenced using the C# keyword or the .NET type name.

Copilot uses AI. Check for mistakes.
@HandyS11 HandyS11 merged commit 781e57d into refacto/ImproveCodeQuality Feb 3, 2026
8 checks passed
@HandyS11 HandyS11 deleted the copilot/sub-pr-12-one-more-time branch February 3, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants