Home  /  Questions  /  Question



0   0
Apr 21, 2016


Patterns in Action or Spark Code First

First of all, Good Job on gathering the information for the .NET Design Pattern Framework, It's exactly what i was looking for.

My question is, as question subject is already saying it, do you guys have any plans or idea to implement or show how to implement Code first approach using EF in Patterns in Action project or Spark framework? Or if there is any possibility for any example for this purpose will also work.

Thank You



508   99.9
Apr 23, 2016
Xeon, thank you for your question. 

Yes, we can easily add Code First and we are considering doing this for the next release. Particularly because Code First is what EF Core supports out of the box. 

However, we're a bit hesitant because Code First is not a good approach when you need to build high-performance, production quality web sites.  With Code First you have little or no control over 1) the data model, 2) data access, and 3) database tuning. The database is merely a 'persistence layer' (i.e. data dump) which is a big red flag -- we write about this in our SQL + Database Design Pattern Framework. 

In general, when an application does not perform well there is a 95% chance its related to the database (i.e. data model and data access). Also, EF is not particularly well known for its performance which explains why Microsoft decided to rewrite it from scratch. 

Fortunately, EF Core is a much more lightweight and agile than prior versions. Having said this, we have written Patterns in Action with EF Core, and I must say, searching with dynamic WHERE and ORDER BY clauses remains very problematic.

For this and many other reasons we feel that our SPARK platform offers a much better (and faster) approach to data access.  

We do recognize that most C# projects will end up using EF, so we will support it (including Code First)..   



 1 comment
 
Thank You for reply Jack, i appreciate it. I completely agree to you about EF behavior but sometime there are unavoidable sitution where you dont have any choice, same is my case : ). Do you have any idea when it next release will be? or if you can give me a small example just for couple domain entities and how i can initialize it , i can work it out ... I appreciate it again --- Xeon Xi  Apr 25, 2016