Asp.net 5 mvc 6 Entity Framework 7 database first - asp.net

I noticed that this type of project does not support files edmx.
What is the right way to develop a project in Asp.net 5 MVC 6 using Entity Framwork 7?

Currently(as of EF 7, RC1) Database First support is still in development. More info on roadmap page here and on EF Design meeting notes here.
Since this is in development there are ways to try this and more info and tutorial on commands can be found at official documentation page here.

The problem is that EF7 kill EDMX. You now have Code First-style POCOs tied to an existing database, without an EDMX file in sight. The EF Power Tools Visual Studio extension can be installed to generate all of this directly from existing database.EF Power Tools Visual Studio extension actually doesn't support vs 2015

Related

Upgrading .NET Framework 4.5 to 4.6.1 causes errors in Entity Framework classes

IDE :: VS.NET 2015
Version Upgrade :: 4.5 To 4.6.1
My asp.net solution contains more than 30 projects inside. I have upgraded the targeted framework to 4.6.1 and now i am getting these tons of error in EF classes. The existing EF version is 6.0.
Please suggest how to fix these errors cropped up from the EF classes. Should i upgrade the EF version also from the Nuget console also.
If you have any models created with the EF Designer, you will need to update the code generation templates to generate EF6 compatible code.
Delete existing code-generation templates. These files will typically be named .tt and .Context.tt and be nested under your edmx file in Solution Explorer. You can select the templates in Solution Explorer and press the Del key to delete them.
Note: In Web Site projects the templates will not be nested under your edmx file, but listed alongside it in Solution Explorer.
Note: In VB.NET projects you will need to enable 'Show All Files' to be able to see the nested template files.
Add the appropriate EF 6.x code generation template. Open your model in the EF Designer, right-click on the design surface and select Add Code Generation Item...
If you are using the DbContext API (recommended) then EF 6.x DbContext Generator will be available under the Data tab.
Note: If you are using Visual Studio 2012, you will need to install the EF 6 Tools to have this template. See Get Entity Framework for details.
If you are using the ObjectContext API then you will need to select the Online tab and search for EF 6.x EntityObject Generator.
If you applied any customizations to the code generation templates you will need to re-apply them to the updated templates.

ADO.NET Entity Data Model missing Visual Studio 2015 community

I am starting a new ASP.NET 5 Preview template to play with client side development.
I have a database ( MS SQL ) that I want to access using the Web API and Entity Framework.
In my Models folder I do like I am used to do, add a new item and I want to add the ADO.NET Entity Data Model but it isn't there.
What am I missing here?
UPDATE
This is the only thing I see when I try to add a new item to the project.
Client side and server side.
After a lot of research, I found out that there are some compatibility issues where come from the recent Microsoft migration to open source world (since Asp.net5) that I obtained from Data Points - The EF6, EF7 and ASP.NET 5 Soup MSDN Article. Read the full article please.
So if you wanna have both EF6 and Asp.net5, consider the article tips. And if you don't persist in using Asp.net5, simply use Asp.net4.5 (following image) which have Ado.net Data Model in Add New Item dialog (I tested its availability with my Visual Studio Enterprise).
May sound stupid, but since I got caught with this, it might be someone else's issue too...
In VS 2015, there are 2 project templates called Class Library... one being in Windows and one in the Web and having (package) suffix. Apparently, besides misleading name they have nothing to do with each other and the second one clearly is not made to support EF models... Make sure you have created a proper project type or open a working solution made with different VS version.
__
Also this might help. I have it already installed, so not sure if it affects my configuration or not (shouldnt as EF tools are supposed to be shipped already with VS 2015):
http://thedatafarm.com/data-access/installing-ef-power-tools-into-vs2015/
Right click on project
Choose Add and then New Item (or Simply press Ctrl+Shift+A)
You will see a Data section which you can find what you are looking for
Or You can find another solution Here:
Missing ADO.NET entity data model template from visual studio 2012 professional
Create New MVC Project using VS2015
Right-Click on Model folder.
Choose Add and then Select Class from the list.
Now select ADO.Net Entity Data Model... and go for your selection.
ADO.NET Entity Data Model missing Visual Studio 2017 Community
How to enable:
Open Visual Studio Installer -> Individual Components -> SDK's, libraries, and frameworks -> Enable EntityFramework 6 tools-> Modify
Now, Add item in your project -> Data -> ADO.NET Entity Data Model.
Visual Studio Installer
Note: While Creating project don't select class Library(.NET Standard) Choose Class Library (.NET Framework)
I solved the same problem by following these:
While Creating project don't select class Library(.NET Standard)
Choose Class Library (.NET Framework)
Choose ASP.NET Web Application (.NET Framework)
Go to Tools -> Get Tools and features. Select Individual components tab and check Entity Framework 6 tools under SDK's, libraries, and framework section
Remember you can't make an ADO.net Entity Data Model with an interface with .NET Core, its only possible with .NET Framework.

Future plans to consider for asp.net mvc 5.2 web application, with releasing asp.net mvc6 (vnext)

I need to get any ideas of how i should be managing our previous asp.net MVC 5.2 web application.. now i am using asp.net mvc-5.2 with entity framework 6.0. and i want to start phase-2 for some of these projects. so should i consider upgrading my mvc 5.2 to be using mvc6 (vnext) first ? and will there be any migration plans ?
second question , when is it expected for vnext to be released? or it is has been officially released ?
third question, will i be able to create a vnext project inside VS 2012 ?
I would simply recommend following the standard best practice of n-tier architecture and keeping logic related to things like querying a database in class libraries. MVC 6 is drastically different from previous versions, so there's no easy migration. You'll basically need to start a brand new project and move over relevant code where you can and spend a good bit of time converting code. For example, child actions are gone and have been replaced with view components. You'll need to go through any child actions you're using currently and create view components out of them. As I said, making sure your current MVC project is as thin as possible (by factoring out code into class libraries and such) will go a long way in reducing the amount of code you need to move/change.
As far as I'm aware, no release date has been set, but at least in the alpha and beta phases of Visual Studio 2015 and ASP.NET 5/MVC 6, Windows 10 has been required, so there won't be an official release likely until Windows 10 is public. However, Visual Studio 2015 has reached release cadidate stage, so I'd say it's definitely close, either launching alongside Windows 10 or shortly after.
Kind of answered this in point 2, but ASP.NET 5/MVC 6 will require VS2015. As far as I'm aware, there's no plans to add support to lesser versions. A lot of that has to do with Rosyln, the new .NET compiler. Trying to bootstrap previous versions of VS with support for an entirely new compiler/syntax engine would be a monstrous task. However, VS has been on an MSDN subscription model for many versions now and as long as you're a current subscriber you can always download the latest version for free. If you're not an MSDN subscriber, you can still download the community edition of VS 2015 for free. It's missing a lot of the more advanced VS features, but it's still totally sufficient for web development work.

VS 2015 Preview missing "ASP.NET 5 Web Application" project type?

In Visual Studio 2015 Preview, I see the following vNext templates in the "New Project" window:
I am under the impression that I should also see an entry for "ASP.NET 5 Empty Web Application" or something similar, but I see no such thing. Those two entries are the only "vNext" designated entries that I have installed.
Is there an additional binary I need to install in order to enable this type of project to appear? Or do I need to examine my VS 2015 Preview installation?
Note: I do have an entry for "ASP.NET Web Application", which takes me through the setup with the unified architecture but does not appear to include a project.json file or things that I'm associating with ASP.NET 5 development.
Update: Per this article regarding 2013 I also tried to run devenv.exe /installvstemplates, but that didn't work either. To clarify, I don't see any new web template, which the screenshot below illustrates as well:
I was having the same problem, except that unlike the accepted answer suggests, the ASP.NET Web Application was not on the list of templates at all.
I was able to get it to show up after following the instructions from this article.
From Visual Studio 2015: Tools -> Extensions and Updates
Select Online then click Visual Studio Gallery
Search for ASP.NET Project Templates and download the first result.
Go through installation process, relaunch Visual Studio, and Web Application should now be an option!
Alternately, you can download the templates directly here.
I believe this download actually is meant to install some other templates that I wasn't interested in, but installing them must have also installed the base template in the process. Either way, it worked for me.
Visual Studio Ultimate 2015 Preview contains everything you need to create an ASP.NET 5 (vNext) web application. One additional generic option should be available that's not depicted in your question:
It's not entirely clear at this point, but choosing the generic web application option will present a few ASP.NET 5 (vNext) options that you're seeking in the following dialog:
In Visual Studio 2015 Preview Microsoft has renamed ASP.NET vNext to ASP.NET 5
If you open http://www.asp.net/vnext, in every article vNext is metioned as ASP.NET 5
In following Sam's Suggestion, I noticed that there were Updates Pending. One of these updates included the missing ASP.NET 5 templates.
Tools > Extensions & Updates > Updates > Visual Studio Gallery
Once updated & Installed, the Web Application was then available as described in the tutorial.
The new update released this week has renamed ASP.NET 5 into a new framework which they are now calling ASP.NET Core. More information can be found in this article https://blogs.msdn.microsoft.com/webdev/2016/05/16/announcing-asp-net-core-rc2/
VS 2015 Preview is going under ASP.net Core web application. If you cant see that one under templates you may go to this site and download .NET Core 1.0 for Visual Studio then install.
In my case the problem was in the Microsoft .NET Core 1.0.1 VS 2015 Tooling Preview 2 corrupted installation.
It was performed:
install the ASP.NET Project Templates following answer from this post - NO RESULT
reinstalling Microsoft Web Developer Tools from the identical SO post - NO RESULT
fresh install the IDE using TotalUninstaller tool - NO RESULT
repair the Microsoft .NET Core 1.0.1 (see the sketch below) - SOLVED
Only repair .NET Core 1.0.1 finally solved the problem!
For that you have to download the .net core cross platform development, below steps you will refer
open VISUAL Studio installer
click the option in the list click modify
below image you can refer it
once complete installation,now you have the option for asp.net core web application

Create MVC 4 application

I asked a question earlier about Changing MVC 5 and .NET target framwork because the application I have will not work with Windows Server 2003 (they didn't tell me that). If you know a way to do this, so I can avoid what I'm about to ask, please let me know.
Anyways, I'm trying to create a MVC 4 web application using the newest from of Visual Studio 2013. In a new application I already changed the framework to .NET 4 but I only find MVC 5 listed when I try to create a new controller.
I'm not really sure what I need to do, if I need to download a later version of Visual Studio or find a certain template.
Also, I learned how to create my web application using this tutorial, so maybe that will give you a better idea where I'm coming from, AKA I'm new at this stuff.
http://www.asp.net/mvc/overview/getting-started/database-first-development/creating-the-web-application
You will find the MVC 4 Application (Based on ASP.Net 4, not 4.5) In the Visual Studio 2012 project types. File -> New Project, Expand the Web node, Visual Studio 2012. The Asp.net MVC 4 Web Application project template will create the correct controller templates. It is not sufficient to create a standard MVC Application (which will be MVC 5) and then change the target framework.
Bear in mind, some examples you may find for MVC may not function exactly as advertised using the older framework type.

Resources