[RESOLVED]which approaches is best to manipulate data for MVC project?

I am going to create MVC base project with EnityFramework.

But Enity Framework has three approaches as we know as,

1)Schema based approach
2)Model based approach
3)Code first approach.

which approaches is best to manipulate data for MVC project?

Christxavier

which approaches is best to manipulate data for MVC project?

THe one that you are used to. MVC does not care about EF, NHibernate, other data technologies.

yes thanks for reply.. But i am going to use EF. 

So, which approach is best in EF among three?

I do prefer EF Code First

Thanks a lot..  to create a  new web application we can use code first approach as you said where we will create model(Classes) which creates database,table and column name automatically.

But what about creating web application from existing database ? In this situation, database(schema) based approach is good option. right?

Christxavier

what about creating web application from existing database ? In this situation, database(schema) based approach is good option. right?

Not necessary.

If you have a database ready , then database first is the right approach !! else code first

It depends on you Chris. Generally Database First/Code First approaches are followed. You can opt any one. But Database First approach would be a better option if you are starting with MVC. There are critical things to learn in Code First approach as well. 

So, I would prefer Database First approach, though I have worked on both.

You are right Sura. But Mikes(MVP) shared that Microsoft will be dropping Database First support in the next version of Entity Framework, which means that if you use it, you will be stuck with EF 6.

So?What shall we do? code first is best right? 

Christxavier

But Mikes(MVP) shared that Microsoft will be dropping Database First support in the next version of Entity Framework,

I do not believe that. Please show links, something.

Some interesting information on Entity Framework 7 and Code First and Database First models.

They are not going to support EDMX format from EF7.

But still code Model can be created from existing data base.Please refer below link for more details.

EF7 – What Does “Code First Only” Really Mean

http://blogs.msdn.com/b/adonet/archive/2014/10/21/ef7-what-does-code-first-only-really-mean.aspx

Note the below point as provided in     http://blogs.msdn.com/b/adonet/archive/2014/10/21/ef7-what-does-code-first-only-really-mean.aspx

So, what will be in EF7?

In EF7 all models will be represented in code. There will be tooling to reverse engineer a model from an existing database (similar to what’s available in EF6.x). You can also start by defining the model in code and use migrations to create a database for
you (and evolve it as your model changes over time).

               It seems Creating models from existing database is still available in EF 7 .. Is am right ??

Abdullah,

" It seems Creating models from existing database is still available in EF 7 .. Is am right ??"

You are right. We can create models from existing database with EF7 also but in a different way not using edmx format.

Leave a Reply