Stay Tuned!

Subscribe to our newsletter to get our newest articles instantly!

Tech

Dev-Notes: Exploring ASP.NET MVC

Code First method build from scratch

  • Make a backup of /Model files and /Migrations and delete xxx_Initial.cs one, delete all files under /Migrations, delete all tables in database
    OR
    Alternatively run: Update-Database -TargetMigration $InitialDatabase to roll back to what it was
  • Run enable-migations -Force in PM>
  • Change the /Migrations/configuration.cs file with file below – notepad
  • Run add-migration Initial in PM>
  • Run update-database in PM>
  • Check the database and all the class table in there as well Identity one (ASPNETxxx) and also the /Migration/xxxxxxxx_Initial.cs appearing with ASPNET as well.

Note

  • The Designer Code for this migration file includes a snapshot of your current Code First model. This snapshot is used to calculate the changes to your model when you scaffold the next migration. If you make additional changes to your model that you want to include in this migration, then you can re-scaffold it by running ‘Add-Migration Initial’ again.

Challenges

Resources

Note: Pageviews – 2,273 (before migrated from Dewalist Blog website on 09/08/2020)

Avatar

Valdy

About Author

Valdy founded Dewacorp.com, a helpdesk and IT Services provider that has taken care of nearly 40,000 customer service requests in the past 15 years - nearly 2,600 per year. He also created the growing Dewalist.com - a classified website that has close to 110,000 page views and 9,000+ user visits per month with 61,000+ yearly published ads and 47,000 active registered users. He blogs for the ever-growing Dewapost.com, a tech blog that gets around 20,000 impressions per month with 700 clicks and 10 average pages first impressions on Google Search. You can reach him on the Contact Us page, social media links below or Dewachat.com.

You may also like

Tech

Guy Kawasaki shared his The Art of the Start Insight @ TiECon 2006 for entrepreneurship startup.

Insights Guy Kawasaki shared his The Art of the Start Insight @ TiECon 2006 for entrepreneurship startup. Here are 10
Feature Tech

A Complete Setup Guide for Contabo VPS Ubuntu 20.04 with preinstalled Webmin + LAMP

Background I haven’t touched the Linux server for ages and getting used to it with Cpanel or Parallel. However, as