Modelling polymorphic associations database-first vs code-first

I personally stick with Database first when using EF on any schema that is this level of complexity. I have had issues with complex schemas in regards to code first. Maybe the newer versions are a little better, but worrying how to try and code complex relationships seems less straight forward then allowing the engine … Read more

How can I call a SQL Stored Procedure using EntityFramework 7 and Asp.Net 5

I hope that I correctly understand your problem. You have existing STORED PROCEDURE, for example dbo.spGetSomeData, in the database, which returns the list of some items with some fields and you need to provide the data from Web API method. The implementation could be about the following. You can define an empty DbContext like: public … Read more

Code-first vs Model/Database-first [closed]

I think the differences are: Code first Very popular because hardcore programmers don’t like any kind of designers and defining mapping in EDMX xml is too complex. Full control over the code (no autogenerated code which is hard to modify). General expectation is that you do not bother with DB. DB is just a storage … Read more