EF Installing and updating databases

Source: Internet
Author: User

First uninstall the Ef:uninstall-package Entityframework-force in the installation ef5.0:install-package entityframework–version 5.0.0

Update Database (http://go.microsoft.com/fwlink/?LinkId=238269) in EF Code first:

1. Enable-migrations Creating Database Scripts

2. Modifying entity classes

3. add-migration XXX Create database update script, where xxx is any character, as long as the guarantee is not repeated

4. Update-database Update Database

5. When we change the entity, execute add-migration XXX one where xxx is a new parameter. You will be prompted to do this again, consistent with the previous parameters.

6. After executing the update-database, the entity synchronizes with the database.

EF Installing and updating databases

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.