Reputation: 1138
In my solution I have a .NET Core project and a class library. The class library is a layer for communicating with a database. I'm getting the error "OrderDataContext is inaccessible due to its protection level", even if I add a reference.
OrderDataAcces is my class library where I have OrderDataContext class, and OrderWebApi is my .net core class, where I defined connectionString in startup.cs:
Upvotes: 0
Views: 180
Reputation: 53
Add a reference to OrderDataAccess Library is not enough to solve your problem.
Your OrderDataContext class is probably not marked as public.
You probably have "class OrderDataContext" instead of "public class OrderDataContext".
Upvotes: 1