Nbearv3--vsplugin Use Tutorial

Source: Internet
Author: User

Version

1.3 [2007-4-24]

Brief introduction

This tutorial describes the use of the VS2005 code generation plug-in in NBearV3.

Goal

Through this tutorial, readers should be able to fully grasp the use of VS2005 code generation Plug-ins in NBearV3.

Code

This tutorial demonstrates the Entitydesigntoentityconfig.xml file sample code, contained in the Tutorials\vsplugin_tutorial directory that can be downloaded from the NBearV3 latest source code ZIP package. Therefore, if you have any questions in the course of using this tutorial, you can refer to the code directly.

Time

<10 minutes.

Body

To use the Nbear vs plug-in, you only need to perform two steps:

First, you need to install the Nbear vs plug-in. You can complete the installation by double-clicking the Dist\setupnbearvsplugin.exe file.

Next, in the project root directory of the Entity design project, create a file named Entitydesigntoentityconfig.xml. You can also copy the Entitydesigntoentityconfig.xml file directly under Tutorials\vsplugin_tutorial, and then make the necessary modifications.

The typical Entitydesigntoentityconfig.xml file reads as follows:

<?xml version= "1.0" encoding= "Utf-8"?> <entitydesigntoentityconfiguration xmlns:xsi= "http://www.w3.org/" 2001/xmlschema-instance "xmlns:xsd=" Http://www.w3.org/2001/XMLSchema "> <compilemode>debug</ Compilemode> <InputDllName>EntityDesigns.dll</InputDllName> <outputnamespace>entities</ Outputnamespace> <OutputLanguage>C#</OutputLanguage> <!--<outputcodefileencoding>utf-8 </OutputCodeFileEncoding>--> <entitycodepath> \entities\entities.cs</entitycodepath> <entityconfigpath> \website\entityconfig.xml</entityconfigpath> <sqlsync enable= "false" > <sqlserverfolder>c:\ Program Files\Microsoft SQL Server\80\tools\binn</sqlserverfolder> <ServerName>.</ServerName> &L T Userid>sa</userid> <Password>sa</Password> <DatabaseName>tempdb</DatabaseName> & Lt;/sqlsync> </EntityDesignToEntityConfiguration>

The contents of the file are relatively easy to understand, from top down:

Compilemode indicates whether the output directory of the DLL that needs to be read is debug or release.

Inputdllname represents the name of the entity design DLL.

Outputnamespace is equivalent to the outputnamespace of the EntityDesignToEntity.exe tool.

Outputlanguage is the language of the generated entities, the optional value is C # or vb.net.

Outputcodefileencoding is the default encoding for the operating system, if unspecified, for the encoding of the code file that is generated to Entitycodepath.

Entitycodepath

Represents the code file that contains the specific entity code that was generated.

Entityconfigpath represents the XML file where the generated entity configuration code resides.

The content in Sqlsync sets the need for and how to connect the database to automatically synchronize the tables and views in the database when the design entity changes. The options should not be explained too much, and they can be understood at a glance.

Working with effects

To experience the powerful features of the Vsplugin plug-in, All you need to do is to open the SLN in the tutorials directory in v3.3.7 and later editions, and compile any entitydesigns project, and you will notice that after the ENTITYDESIGNS project is successfully compiled, Entities.cs and Entityconfig . XML code, and even the associated database representation diagram structure is automatically updated synchronously. All of these processes originally require the user to manually use the EntityDesignToEntity.exe tool to generate synchronization, and now, all of this can be done by Vsplugin to help you.

Attention

Please note that the values of Sqlserverfolder in Sqlsync in the entitydesigntoentityconfig.xml in all tutorials and the corresponding Servername,userid and password are modified. Alternatively, you can temporarily set the Sqlsync enable to false.

For SqlServer2005, the value of the general Sqlserverfolder should be set to X:\Program Files\Microsoft SQL Server\90\Tools\Binn.

This article concludes

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.