0

I'm trying to create a crud web app. I'm getting errors about the name space, which I can't figure out (sure it's something simple!) What does the type or namespace could not be found mean? It's only on pages related to the database. Or is there a way to link the sqlite database without a migration folder - ProjectContext file?

enter image description here enter image description here

2
  • 1
    Is ProjectContext your own class? Did you write it? Right click on it and click "Go To Definition. What namespace is it declared in? Commented May 5, 2021 at 15:37
  • 1
    If ProjectContext is not your own class then it can be from 3-rd party library. In such case you should reference external nuget/lib and/or add using statement. If you still need a help, then write what application are you trying to program. Do it by editing question. Commented May 5, 2021 at 15:55

1 Answer 1

1

This class looks like it exists but in a different namespace to the one the controller is in. You will either need to provide a full refeerence to it's location:

Place1.Place2.ProjectContext

or a using statment at the top.

using Place1.Place2;

Visual studio has a shortcut to help you track down classes like this, right click on the problem class and click "Quick actions and Refactoring..." and you may be presented with an option to either insert a 'using' statement at the top or use a full reference.

Quick actions and Refactoring

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.