Tags » Entity Framework

Using Views with Entity Framework Code First

In today’s post I’ll show how we (some of the code was written by my friend Nuno Moura, thank you) use views with EF6. This, apparently simple, post came into discussion after a recurrent debate with my colleagues about the pros and cons of using lazy loading and eager loading. 1,705 more words

Entity Framework

IEnumerable vs IQueryable - Part 1

What’s the difference between IQueryable and IEnumerable? This is probably the second most frequent question I’ve been asked (number 1 has to be understanding delegates… 1,041 more words

.NET Development

Entity Framework Wonderland: Migrations and Seeding

This post is a practical dive into Entity Framework 6 migrations and seeding in an ASP.NET MVC 5 web application.

Initial Setup

Suppose we have the following model: 660 more words

.NET Development

Display Menu Items On Hover

Add to Site.css >

@media (min-width: 768px) {
.dropdown:hover .dropdown-menu {
display: block;

.dropdown:hover .dropdown-menu {
display: block !important;

Copy/Paste of menu dropdown on hover > 103 more words

Unit testing your Repositories

The problem

We have created are data layer, and of course we want to test it.

It is very hard to use a (physical) database to test your code. 1,189 more words


The Entity Framework provider type… exception when unit testing

While merrily going about my business creating an MVC project using Entity Framework 6 against an Oracle database, I decided that unit testing my data layer would be a fun, useful thing to do. 119 more words


Beware of IEnumerable with Entity Framework

Sometimes you want to build a generic data access layer out of your entity framework concrete context, and you want to use the precious generic method on the DbContext such as the generic Set(). 116 more words