Code generation for .Net MVC 4.5? - asp.net-mvc

I really hope that this isn't a duplicate post somewhere else on SO but I've searched long and hard and I'm coming up blank.
In PHP if you used a framework like CakePHP you could "bake" your project which would generate the code for your models, views and controllers using your MySQL database ERD (see here http://book.cakephp.org/2.0/en/console-and-shells/code-generation-with-bake.html). This saves tons of time and has become a requirement for me these days.
That said. I can't seem to find any information if a similar function exists either in Visual Studio 2012 or the MVC 4.5 framework. Does anyone know if I can "bake" a .Net MVC 4.5 project from my DB schema?
Thanks in advance for any help.

It is called Scaffolding. You can read a nice tutorial on codeproject: Database First Development with ASP.NET MVC Scaffolding and Entity Framework

Related

How can i implement asp.net with existing Database using database First in asp.net mvc, i'm using mac os

In mysql server, i create a database with tow tables after i create a new project asp.net mvc in visual studio but i don't find how to implement asp.net with existing Database using database First in asp.net mvc, i'm using mac os.
If you want to use your existing database for your project then you can easily do it with Database First approach.
Please follow this official Microsoft Documentation for detailed explanation of "Getting Started with Entity Framework 6 Database First Using MVC 5".

Issue with Visual Studio 2013, MVC 4.0 application and Web API 2.2 Nuget Package Install

I have a standard MVC 4.0 project for my application which was working correctly. I needed to use WebAPI within the same project so I installed the Nuget Package for WebAPI 2.2.
All seemed well and WebAPI ran fine after some tests, and my project also ran fine, except for the fact that now I cannot add standard MVC controllers, they all refer to adding a WebAPI controller and also options to add a standard view from an action inside a standard MVC controller using the Right Click context menu are now missing.
It seems as if it is assuming it is a WebAPI project only now, however I still need all MVC related options to be present. I am using Visual Studio 2013.
Any advice on this appreciated.
I believe it is not possible to use both WebAPI and MVC in the same project.
I managed to get it pretty much working using two projects in the same solution e.g. MyProject.MVC project and MyProject.API. However this turned out to be a bit clumsy, the biggest issue for me was getting Unity to work for both cases. Eventually I got that working too, but after a few days I figured I didn't actually need the WebAPI portion and it was causing more work than it was worth, so I removed that from the solution.
Not sure this answers your question tbh, but hopefully useful in some way. Btw in the next version of MVC6 (vNext) they are apparently planning to combine the Mvc and WebApi parts into a single framework, so this should ease the pain!

Modular/Plugin Framework In ASP.Net MVC 5

I want to create a web application using ASP.Net MVC5. It is a big enterprise application and having lots of modules, earlier i worked on Siverlight and use the Prism architecture.
I already Google this and found lots of posts but most of them are at least 1 year old so just want to know Is there something new coming introduced which help me to implement the plugin framework.
Hi I was also in search of similar things. I found below helpful.
MVC plug in architecture
MEF in MVC

does nhibernate.burrow work with mvc.net and dot net 4.0 framework

I am thinking of using nHibernate.Burrow in my mvc.net application. However there are several troubling things that I have read and I am hoping to get them sorted out before I embark on the project:
Are there any issues with running .Burrow with mvc.net?
Are there issues with running .Burrow with the 4.0 framework?
How tightly coupled is .Burrow with the nHibernate? I have read several things indicating that I have to use the same version of nHibernate as was used to create the .Burrow binaries.
Any other thoughts that people have?
Yes, you should use Burrow with appropriate NHibernate version. If you want to use it with another one you can try to put assemblyRedirect in web.config file.
And I wouldn't try to use Burrow with MVC. Yes, it has Session magement and some other usefull featrures, but they are tied to ASP.NET Web Forms.
As a base framework for mvc applications I would suggest Sharp Architecture. It has all required binaries and all versions are latest.

Entity Framework 4.0 - Code only Reference

I am trying to learn EF 4 and its code only features. I tried the following great articles and was able to make a sample application.
http://blogs.taiga.nl/martijn/2009/11/22/entity-framework-4-0-a-fresh-start-with-demo-application/#reply
http://blogs.msdn.com/efdesign/archive/2009/10/12/code-only-further-enhancements.aspx
But I am looking for a good reference library / website on Code only feature. I tried searching MSDN but couldn't find it.
Please help.
Thanks a lot.
There might not be many of them yet. Code only is still in beta-stage and was not released with Visual Studio 2010 RTM. If you plan to use it in a productive environment you should consider using fluent nhibernate or waiting to the final release.
http://blogs.msdn.com/efdesign/archive/2009/06/10/code-only.aspx
http://blogs.msdn.com/efdesign/archive/2009/10/12/code-only-further-enhancements.aspx
Here is a blog article with fully working sample code in ASP.NET MVC 2 in a tutorial form that shows how to use both EF 4.0 Code First and in conjunction with ASP.NET MVC 2. It discusses advanced features of EF 4.0 Code First such as mapping to existing databases and customizing the standard conventions in EF 4 Code First.
The link: http://theminimalistdeveloper.com/how-to-map-to-existing-databases-in-entity-fr

Resources