Section One - CSLA Gen Overview

From Cslagen

Jump to: navigation, search

And I thought I was the sseinble one. Thanks for setting me straight.

What I find so itneresting is you could never find this anywhere else.

[edit] Creating a New Project in CSLA Gen

To create a new project within CSLA Gen click the Image:image018.jpg icon. The Project Properties dialog will appear. This dialog has two tabs as shown below.

  • (document revision placeholder) new Import button added to dialog

The table below describes the fields on the Project Defaults tab.

Database

The alias of the database that CSLA Gen will used when building the Data Portal method code in generated classes.

Transaction Type

The Transaction Type that the Data Portal methods will use.Available options are as per normal in CSLA i.e.

  • None
  • ADO
  • Enterprise Services
  • TransactionalAttribute

Namespace

If you want to place the classes generated by your project into a namespace then the name of the namespace should be entered here.

Folder

If you want the classes to be output to another folder which is relative to the projects main output directory then this should be entered here.e.g. if ‘Core’ was entered here and the project had been defined with an Output Directory of ‘C:\MyApp’ then generated classes will end up in ‘C:\Myapp\Core’


When generating objects in CSLA Gen you also have the option to create a set of SQL Server stored procedures. I will cover how this is done later on but for now imagine that the developer using CSLA Gen wanted the names of their stored procedures to follow a certain pattern. The properties on the Stored Procedures tab allow you to do this.

General SP Prefix

All stored procedures will be prefixed with these characters.

Select Prefix

The Select stored procedure will be prefixed with these characters.

Insert Prefix

The Select stored procedure will be prefixed with these characters.

Update Prefix

The Select stored procedure will be prefixed with these characters.

Delete Prefix

The Select stored procedure will be prefixed with these characters.

General SP Suffix

All stored procedures will be suffixed with these characters.

Select Suffix

The Select stored procedure will be suffixed with these characters.

Insert Suffix

The Select stored procedure will be suffixed with these characters.

Update Suffix

The Select stored procedure will be suffixed with these characters.

Delete Suffix

The Select stored procedure will be suffixed with these characters.

Ho ho, who woluda thunk it, right?

[edit] Example B: Naming Stored Procedures using both Prefixes and Suffixes

Imagine we are generating a class named Person for an application called Object Basics and we want our stored procedures to be named as follows.

ob_PersonDelete_sp

ob_PersonFetch_sp

ob_PersonInsert_sp

ob_PersonUpdate_sp

Then we would have to set the Stored Procedure properties as follows.

General SP Prefix

ob_

Select Prefix

Image:1x1_White.png

Insert Prefix

Image:1x1_White.png

Update Prefix

Image:1x1_White.png

Delete Prefix

Image:1x1_White.png

General SP Suffix

_sp

Select Suffix

Fetch

Insert Suffix

Insert

Update Suffix

Update

Delete Suffix

Delete

Once all the project properties have been set press the Save button and the dialog will close writing your settings to the project file.

The Project Name should be entered and the project file should be saved by clicking the Image:CSLAGen0005.jpg button. If this is the first time that the project has been saved, then a file save dialog will appear. Navigate to the folder that you wish to same the project file to and press Save.

At this point the project is ready to have a database connection set up and objects added to it.

You have the monopoly on useful information—aren't moopnolies illegal? ;)

Extremely helpful atrcile, please write more.


Personal tools

sl
דומיין בעברית  דומיין  דומין  תוכנה לניהול  קשרי לקוחות  CRM, ניהול קשרי לקוחות  דומין בעברית  פורומים  ספרדית  גיבוי