Error: Inconsistent accessibility: property type 'type' is less accessible than property 'property'

Error: Inconsistent accessibility: property type 'type' DbSet<Users> is less accessible than property 'property'EFCoreDbContext.User.
No description
No description
10 Replies
SinFluxx
SinFluxx7mo ago
internal is less accessible than public also you'd ideally name your model User and your dbset Users
Serene Sphinx
Serene Sphinx7mo ago
Can I make internal as public? will this work?
SinFluxx
SinFluxx7mo ago
try it and see
Serene Sphinx
Serene Sphinx7mo ago
Yess Error: The entity type 'Users' requires a primary key to be defined. If you intended to use a keyless entity type,
SinFluxx
SinFluxx7mo ago
with EF you'd typically have a property on your model like Id or you can define what you want your key to be by using the [Key] attribute on that property (would need to be something that's unique)
Serene Sphinx
Serene Sphinx7mo ago
Okay New error occured now: Error: An exception has been raised that is likely due to a transient failure. Consider enabling transient error resiliency by adding 'EnableRetryOnFailure' to the 'UseSqlServer' call. Why this error what's wrong here now?
SinFluxx
SinFluxx7mo ago
It tells you in the error what you can try to rectify it:
Consider enabling transient error resiliency by adding 'EnableRetryOnFailure' to the 'UseSqlServer' call.
Serene Sphinx
Serene Sphinx7mo ago
I'm new and learning EFCore I don't have idea
Serene Sphinx
Serene Sphinx7mo ago
Soo thanks