Entity Framework Code First internal class - is it possible?
问题 Is it possible to have Code First data classes declared with internal access as shown: internal class Person { public int Id { get; set; } public string Name { get; set; } } I have a requirement that classes and its properties should not be visible outside of the assembly. 回答1: As long as your DbContext derived class that exposes your class to EF is in the same assembly, you should be able to. I don't happen to design my apps that way as I prefer more separation. But the context should be