Add View-& gt; Strongly-typed view-& gt; Model Class

Source: Internet
Author: User

At the beginning, domain cannot be found in model class every time you add view. entities. product, you do not care about it. You can fill it in by hand. You can change it after the view is displayed. You can also find it by yourself.
Now the admincontroller part is used, and the list in the scaffold template is used, and the ghost will be killed, because if it cannot find the model, it will be gray to select the template.
I searched it everywhere and found that it was good to compile it. there are also funny foreigners who make up their minds to turn off VS and re-open it. But it is only suitable for some of them and not for me who are sad.
 
Build-rebuild-clean.
Simply download the source code of this book and compare the reference and using slightly. The result shows that it is quite different. the author also did not know to remind me that it was too unfriendly and he was in a hurry to become a book.
There are two aspects:
1. SportsStore. Domain-> Add reference
System. Runtime. Serialization
System. Web. Mvc
 
2. Change the using list of SportsStore. Domain. Entities. Product to the following:
Using System. ComponentModel. DataAnnotations;
Using System. Web. Mvc;
 
Sadly, even if these references are not available, the program can still run, but it cannot be displayed in scaffold... just... one is a headache, and I cannot find any place to explain how this list is obtained.

Excerpt from truthful information

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.