Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
We are new in MVC
We are creating small prototype in MVC in less time.In this database changes may occur continuously .So which model should we use entity database first model or code first or model?Can we use mix type(Database and Code first) to achieve the result?
Thanks in advance.....
Posted

The advantage of code first is that the changes to your database will be much easier and quicker...however you'll lose whatever data is in your tables every time you update your schema. If this is an issue you might want to think about doing code first. You can write routines that automatically inject data when the db is re-created, but that's obviously additional effort to bear in mind.

If there is a chance that "the prototype" is going to become "the real thing", then you'll want database first for the reasons above. You can change from code-first to db-first so it's not the end of the world, but again it's additional work to think about.

So if it's genuinely a prototype then code first is probably best.
 
Share this answer
 
First of all, what database technology are you using...SQL Server, Oracle, Azure, Access,NoSQL,Hadoop ? . Secondly what data does the database provide. You should know these things before you even start on MVC and Entity Framework (which is not a database but essentially an ORM wrapper for ADO)
 
Share this answer
 
Comments
sp_suresh 21-Jan-16 8:57am    
Database currently is SQL server but on production server may be Mysql.....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900