Codefirst first Experience-Question two

Source: Internet
Author: User

Quickly create model with Codefirstexistingdatabase

Of course, this can only be done after creating a good database using Codefirst to generate all the tables at once, the model uses Dataannotation identity metadata, you can also modify it to use FLUENTAPI, This preserves the purity of the model (as netizens describe it), This allows you to write the configuration of each model into a dedicated FluentAPIconfig.cs file and then write a initconfig file to initialize all the model configurations so that you can call initconfig directly in the Onmodelcreating method and later maintain is also very convenient.

This usage can only be used once when creating the model, if the database table changes later or you need to manually modify the model, this way, the biggest advantage is to save you time

Codefirst first Experience-Question two

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.