EF Code-First Stored Procedures With Parameters

Summary In an earlier post I showed how to create a method that can access a stored procedure using Entity Framework Code-First. In this post I’m going to show how to pass parameters and show a few tricks. The Stored Procedure First, you’ll need to create a new stored procedure in your APIUniversity database (see … Read moreEF Code-First Stored Procedures With Parameters

EF Code-First Stored Procedures

Summary In this post I’m going to show the very basics of calling a stored procedure from Entity Framework using the Code-First technique. The Database Setup First, I’m going to create a database named “APIUniversity”. If you’ve tried out the API projects from my previous posts, you probably already have this database in place and … Read moreEF Code-First Stored Procedures

Entity Framework Code-First and Code Only

Summary In this blog post I’m going to explain the basics of Entity Framework code-first. I’ll show how to setup your context so that a database is not generated. Code-First / Code-Only If your database is already in place, then the most obvious method of using EF is to use Database First. This is where … Read moreEntity Framework Code-First and Code Only

Entity Framework Unit Testing with SQLLocalDB

Summary I’ve published a few blog posts on the usage of SQLLocalDB with NHibernate. Now I’m going to demonstrate how easy it is to use with EF. In fact, SQLLocalDB can be used with ADO queries and LINQ-To-SQL. If you’re dealing with legacy code and your methods use a lot of database access operations, it … Read moreEntity Framework Unit Testing with SQLLocalDB

Entity Framework 6 Mocking and Unit Testing

Last week I attempted to mimic this article from Microsoft: Testing and Mocking Framework.  I ran into a problem involving some code that was in the article last week, but has since been removed (I’m assuming that Microsoft changed something in their EF6 framework or .Net and didn’t update the article before I tested it).  … Read moreEntity Framework 6 Mocking and Unit Testing