I would like to share with you a poco template of Entity Framework 4.

Source: Internet
Author: User

ASIDE: before sharing this template, I would like to share with you some of the things worth thinking about in a letter written by Philip Su, who has just left Microsoft for 12 years.

1. Choose carbs. eat dessert first

2. Words matter. connotations matter.

3. Listen to understand. Speak to be understood.

4. The team you want to join is the one that's hard to get.

5. Follow great people. Work for great people.

His original article is here. If you want someone to translate it, I will post a link to you.

Goodbye Microsoft, hello Facebook!

If you read this article, I think you will benefit a lot.

Go to the topic. Today I will share with you an Entity Framework 4 poco template. EF Team previously made a template for you. I don't think it is very good. Here we will share a better template for you. You can use this template to add, delete, modify, and query all files automatically. You can also improve the template by yourself.

Nicolas pocotempalte. vsix.

Download it to your local computer, decompress the package, and you will get a template named "niklaspocotempalte. vsix. For example:

After running the template, if the following interface is displayed, it indicates that you have successfully installed the template, restart vs2010.

Next I will explain how to check the installed plug-in and how to use it:

After vs2010 is enabled, go to the "tool-> extesion manager" menu to view the plug-in:

It has been installed. If you do not want to use it, you can uninstall it here.

How to use it?

Create a project and add an ADO. NET data model to the project, that is, the. edmx file. The default setting is to prevent it from automatically generating code.

Note that it is best to set edmx to model. edmx, because the model. edmx file is imported by default in the template. You can also modify the imported edmx file name in the. tt file after the template is generated.

Now with edmx, we can use the POCO template to generate code.

 

On the Design page of Ed MX, select 'add code generation item ',

The following page is displayed:

Select the template you just installed. Note the prompt on the right that we need to create a models folder to store the generated files. Click OK to generate the following template:

In the near future, I will share with you how to use t4mvc with this template.

If you are interested in generating a vs2010 plug-in, I suggest you look down:

First, you need to download the vs2010 SDK. The default installation is 2010 and does not come with it. You need to install it manually.

After the installation is complete, you create a Project Department Branch to add some templates, such:

Create a vsix project. The default Interface is as follows:

You need to fill in the plug-in name, sit, version, description, and so on. The most important part is the 'content' section. Remember

Add your own template. It is generally a. ZIP file.

Click Run to generate a. vsix file.

I hope to help you.

Cheers

 

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.