NBearV3 Step through Step Tutorial--orm Progressive Chapter

Source: Internet
Author: User
Tags zip

Version

1.2 [2006-11-12]

Brief introduction

This tutorial, on the basis of the previous article "NBearV3 Step through step tutorial--orm", demonstrates the entity autocorrelation relationships that are not covered in the previous article; Settings for performance-related attributes: Indexproperty,batchupdate , and discusses the use and considerations of strongly typed query methods in the NBear.Data.Gateway class, especially the performance variance analysis under different attribute setting options.

Note: Before reading this article, readers are advised to read the NBearV3 step by step tutorial--orm to master the basics of ORM in NBearV3.

Goal

Through this tutorial, readers should be able to more fully grasp the use of NBearV3 ORM module for application design process, understand the physical design of the important performance-related options, and fully understand the NBear.Data.Gateway in the use of various strong-type query methods.

Code

This tutorial shows all the projects and code you created, contained in the Tutorials\orm_adv_tutorial directory in the NBearV3 latest source code ZIP package that you can download from sf.net. Therefore, if you have any questions in the course of using this tutorial, you can refer to the code directly.

Time

<30 minutes.

Body

Step 1 Download the latest version of NBEARV3 and prepare

1.1 Access to Http://sf.net/projects/nbear, download the latest version of NBearV3 to the local directory.

1.2 Extract the downloaded zip file to C:\, you will see that the NBearV3 directory after the compression includes: Dist, doc, cases, SRC, tutorials directory. In this tutorial, you will use the ORM Basics tutorials in all release compiled versions of DLLs and EXE and tutorials directories in the Dist directory.

1.3 Copy the entire orm_tutorial directory in the tutorials directory to any other location and name it orm_adv_tutorial, we will demonstrate the ORM advanced knowledge in NBearV3 based on Orm_tutorial.

Step 2 extended design entities and metadata

2.1 Rename the Orm_tutorial.sln in orm_adv_tutorial to Orm_adv_tutorial.sln and open in the VS2005 development environment.

2.2 In the Group.cs file of the Entitydesigns project, add the ParentID property and add the Indexpropertyattribute setting for the ParentID property as follows:

[IndexProperty]
Guid ParentID
{
get;
set;
}

Marking a property as indexproperty means that a single-column index is automatically created for the property in the database creation script that is generated by NBear.Tools.EntityDesignToEntity.exe. We all understand the role of database indexing-which will help to improve query performance with this attribute as a condition.

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.