-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New rule S3363 (C#): Date and time should not be used as types for primary keys #7086
Closed
8 of 9 tasks
Closed
8 of 9 tasks
Labels
Projects
Milestone
Comments
csaba-sagi-sonarsource
added
Area: VB.NET
VB.NET rules related issues.
Area: C#
C# rules related issues.
Type: New Rule
Implementation for a rule that HAS been specified.
labels
Apr 14, 2023
The |
zsolt-kolbay-sonarsource
changed the title
New rule S3363:
New rule S3363 (C#): Timestamps should not be used as primary keys
Jun 21, 2023
DateTime
and DateTimeOffset
types should not be used as primary keys
github-actions
bot
assigned cristian-ambrosini-sonarsource and unassigned zsolt-kolbay-sonarsource
Jun 21, 2023
github-actions
bot
assigned csaba-sagi-sonarsource and zsolt-kolbay-sonarsource and unassigned cristian-ambrosini-sonarsource and csaba-sagi-sonarsource
Jun 21, 2023
github-actions
bot
assigned csaba-sagi-sonarsource and unassigned zsolt-kolbay-sonarsource
Jun 22, 2023
github-actions
bot
assigned zsolt-kolbay-sonarsource and unassigned csaba-sagi-sonarsource
Jun 22, 2023
github-actions
bot
moved this from Review in progress
to Review approved
in Best Kanban
Jun 22, 2023
github-actions
bot
assigned zsolt-kolbay-sonarsource and unassigned zsolt-kolbay-sonarsource
Jun 22, 2023
zsolt-kolbay-sonarsource
changed the title
New rule S3363 (C#): Timestamps should not be used as primary keys
New rule S3363 (C#): Date and time should not be used as a type for primary keys
Jun 23, 2023
zsolt-kolbay-sonarsource
changed the title
New rule S3363 (C#): Date and time should not be used as a type for primary keys
New rule S3363 (C#): Date and time should not be used as types for primary keys
Jun 28, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Implement new rule S3363:
DateTime
andDateTimeOffset
types should not be used as primary keys.The rule raises an issue if: Entity Framework, or Entity Framework Core dependencies are found and a class contains a property of temporal type (
DateTime
,DateTimeOffset
, etc.) that is either namedId
,<type name>Id
or decorated by the[Key]
or[PrimaryKey]
attribute.DateTime
,DateTimeOffset
,TimeSpan
TimeOnly
andDateOnly
types EF Core 7.0+)[PrimaryKey]
attribute (EF Core 7.0+)The text was updated successfully, but these errors were encountered: