2

I could not get the reflection type for this LoginViewModel:

 public class LoginViewModel
    {
        public string Email { get; set; }
        public string Password { get; set; }
    }

Scaffolding forced me to choose the context, but "LoginViewModel" is not listed in contexts:

This is the error I get:

How do I solve this?

PasWei
  • 171
  • 1
  • 6
  • Do you mean you have a different Dbcontext for LoginViewModel but you are not able to select it? What happens if you try to click the Add button(+ icon)? Are you able to see your Dbcontext? Could you please inform us how you have created the Dbcontext? – Deepak-MSFT Aug 03 '22 at 05:49
  • Loginviewmodel is just a model created to scaffold to create strongly type view but the wizard force me to choose context (I need to scaffold without using context) – kerolos saber Aug 03 '22 at 10:25
  • I understand that you need to select the Context file but you want to scaffold without it. I would suggest try to create empty context file or context file with the dummy values that you could select while scaffold. See whether it work that way. – Deepak-MSFT Aug 11 '22 at 05:12

1 Answers1

0

This is often caused by a mismatch of versions. Check your Nuget packages. Refer to this question: asp.net mvc core The call is ambiguous between the following methods or properties:

Brian W
  • 5
  • 3