Entity Framework

Initial Values for Entity Framework Code First Forms

February 24, 2015 by Chris Sherman

In this tutorial, I’ll explain how to initialize Entity Framework Code First views with default values. Entity Framework Code First provides a declarative method for easily creating CRUD applications with the ASPASP Dot Net MVC framework.

Continue reading

Code First Migrations with Continuous Integration

February 19, 2015 by Chris Sherman

Entity Framework’s Code First Migrations keeps the database in sync with its underlying data model, and Visual Studio provides a convenient checkbox within the Publish Wizard to execute Code First Migrations when publishing manually. If you use continuous integration to publish from source control, however, you still need a way to run migrations on the database. In this tutorial, I’ll explain how to add a flag that sets off the migration task.

Continue reading

Multi-Property Validation Attribute with EF Code First

February 17, 2015 by Chris Sherman

Entity Framework provides several built-in validators for individual properties on Code First models. When you want to validate multiple, dependent properties, however, in most cases you will need to create a custom, class-level validation attribute. In this tutorial, I’ll explain how to do just that.

Continue reading