3

I am trying to build ASP.NET core 1.0 application which also involves API controller. As far as I know I cannot use .edmx files. But how do I add API controller with REST actions using Entity Framework?

I have added all necessary entity frameworks packages in project.json

"Microsoft.EntityFrameworkCore.SqlServer": "1.0.0",
    "Microsoft.EntityFrameworkCore.SqlServer.Design": {
      "version": "1.0.0",
      "type": "build"
    },
    "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },

When I right click on controller then goto controller option. In Add Scaffold I not getting any options. How to enable option like d API controller with REST actions using Entity Framework?

My environment is VS2015 Professional update3 and a Windows 7 machine.

Thanks & Regards

Vishal

1
  • Thanks @marc_s for correcting typo :) Commented Sep 4, 2016 at 8:55

1 Answer 1

1

You must be missing these in your dependencies section of project.json-

"Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
  "version": "1.0.0-preview2-final",
  "type": "build"
},
"Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
  "version": "1.0.0-preview2-final",
  "type": "build"
}

Add these in dependencies and once these are loaded successfully, check whether you are getting required scaffolding option.

For more information refer this article

See if this helps.

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.