Tag: code-first

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 focus on instructing Entity Framework’s database generation engine how the database should be structured. Column Specify what column name to use for this




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 model into a relational database. You can also use validation rules to specify what values are allowed in your parameters. When




%d bloggers like this: