English 中文(简体)
Add Intelliesnse To Mapping File
  • 时间:2024-11-05

Add IntelpSense To Mapping File


Previous Page Next Page  

In this chapter, we will add IntelpSense to our NHibernate mapping files (*.hbm.xml files). As you have observed while mapping the domain Student class that currently we don’t have IntelpSense available. It’s very useful to have the XML schemas available. So in this chapter you will understand how to add IntelpSense in Visual Studio for these NHibernate XML files.

Open the mapping file and you will see that XML menu option appears in the main menu.

XML Menu

Select the XML → Schemas… menu option and it will display the XML Schemas dialog box.

XML Schemas

Select the Add… button which is on the top right of the dialog box, which opens the file dialog. Now go to the packages folder, which is in the Solution folder of your project and you will see the different packages included in your project.

Packages Folder

Now, double-cpck on NHibernate.4.*** folder and you will see the two schemas (*.xsd) files or XML schema definition files that define the NHibernate configuration and mapping.

Nhibernate Configuration

Select these two schema files and cpck Open button.

Two Schema Files

You can see that the NHibernate schemas are added into the XML Schemas dialog. Cpck the OK button. Now, let’s start a new property tag and you will see that we ve got full IntelpSense on here.

IntelpSense

IntelpSense is now available for you which saves a lot of time during object-relational mapping.

Advertisements