I will be the first to admit that I have a love hate relationship with Entity Framework. One of the things that I do love about Entity Framework is that it provides a seed method that it can automatically call for you after it runs data migrations. When implemented, this method can be used to create test data in Entity Framework. In…
Tag: entity framework
Why To Use the Repository Pattern
I felt it was time to update and clarify some previous thoughts on the use of the Repository pattern. Previously, I had indicated that a Repository did not provide much benefit, as ORMs act as a Repository. Although true, I had a very specific context in mind when saying this – anemic domain models. When you’re working with anemic domain…
Why Not to Use the Repository Pattern
The Repository pattern, as described by Edward Hieatt and Rob Mee in Martin Fowler’s Patterns of Enterprise Application Architecture, is a layer of abstraction that is used to mediate interactions between the domain and the data mapping (ORM) layers. You can use a repository to minimize the duplicate query logic that a can arise in larger domains. Often times, I…