Skip to content

Conversation

@GPAPD
Copy link
Contributor

@GPAPD GPAPD commented Dec 31, 2025

The EF Core documentation for Keys
Currently shows example entity classes declared as internal.

Using internal limits the entity to the same assembly, which can be confusing, because entities are typically accessed from other parts of an application such as controllers, services, or unit tests.

This PR updates the examples to use public for entity classes, which is the recommended practice in real-world applications and better standard EF Core usage.

// Before
internal class Car
{
public string Id { get; set; }
public string Make { get; set; }
public string Model { get; set; }
}

// After
public class Car
{
public string Id { get; set; }
public string Make { get; set; }
public string Model { get; set; }
}

No functional changes are made.
This is a documentation improvement for clarity and correctness.

@GPAPD
Copy link
Contributor Author

GPAPD commented Dec 31, 2025

@dotnet-policy-service agree

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

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

Thanks!

@roji roji merged commit 36e1f85 into dotnet:main Dec 31, 2025
4 checks passed
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