Quantcast
Channel: BJ Focus Labs » entity framework
Browsing all 4 articles
Browse latest View live

When both update-database and add-migrations fail while referring to each other

Today I checked out a project from Git on a new machine. The project was using Entity Framework to connect to a local SQL Server on my developer machine. To install the database I ran update-database...

View Article


Image may be NSFW.
Clik here to view.

Validation attributes in Code First

DataAnnotations are really helpful when creating a model in Entity Framework Code-First. They are a simple way of instructing EF how you want the model to be structured and how it should translate the...

View Article


Image may be NSFW.
Clik here to view.

Database related attributes in Code First

This post is a follow-up on the post about Validation attributes in Code-First. While validation attributes focus on making sure the data in the model is correct, the attributes listed here instead...

View Article

Mocking async repository calls

Mocking is a great technique for isolating code that you want to test. By mocking the interfaces a code section depends on you can create an isolation level where only the behavior of this specific...

View Article
Browsing all 4 articles
Browse latest View live