0

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:

Added reference

1 Answer 1

1

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".

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.