Skip to content
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 (VB.NET): Date and time should not be used as types for primary keys #7490

Closed
2 tasks done
zsolt-kolbay-sonarsource opened this issue Jun 21, 2023 · 0 comments · Fixed by #7513
Closed
2 tasks done
Assignees
Labels
Area: VB.NET VB.NET rules related issues. Type: New Rule Implementation for a rule that HAS been specified.
Milestone

Comments

@zsolt-kolbay-sonarsource
Copy link
Contributor

zsolt-kolbay-sonarsource commented Jun 21, 2023

Implement new rule S3363: DateTime and DateTimeOffset 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 named Id, <type name>Id or decorated by the [Key] or [PrimaryKey] attribute.

  • Implement Rule S3363 for VB.NET
  • Convert C# test cases to VB.NET
  • Implement VB.NET rule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: VB.NET VB.NET rules related issues. Type: New Rule Implementation for a rule that HAS been specified.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants