ASP. net mvc 5 models uses the object class automatically generated by LINQ

Source: Internet
Author: User

1. Create a LINQ class file in models.

Right-click the models folder, select a class, and select LINQ to SQL.

2. Create and generate object classes.

In vs, open "service resource manager", create a database with the link created, and drag the table to the window opened after the newly created LINQ class file.

After saving the file, the object class is generated.

3. Use it in the controller.

The usage of the. CS file built in models is the same, because the generated instance class is also in bxhlcms. Models. cms_admint.

For details, see ASP. net mvc 5 models.

Next article: entity classes automatically generated by using LINQ in ASP. net mvc 6 models

Related Article

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.