Entity Framework Seed Data for States & Counties

Written by rsolberg on. Posted in All, Software Development, Technology

One of the great benefits of Entity Framework and Code First for ASP.NET MVC application development is the ability to seed data for your application when you run your application for the first time. Earlier today I was working on an implementation of EF and Code First for a new app and I had all kinds of fun in Excel concatenating() my c# code to seed States and Counties in my app. Rather than force everyone else out there to experience the same joy I did, I through the code into a quick app and posted it on GitHub for you all. As you can tell, duplicating this could be quite fun! Below are just a few of the snippets. Please note, I did not add all of the Provinces for Canada yet as not all of the Provinces use counties. I’ll update the code or you can if you need it before me! You can pull the code from GitHub and contribute to it as you like. GitHubCloneIt
Be Sociable, Share!

Tags: , , , ,

Trackback from your site.

Leave a comment

© Copyright RSolberg, 2003 - 2014. All Rights Reserved