Section Three - Building Objects with CSLA Gen

From Cslagen

Jump to: navigation, search

In this section of the online reference I will run through creating each type of CSLA object within a CSLA Gen project. I will then generate the classes and show them compiling under Visual Studio 2005 and the current release of CSLA .NET.

CSLA Gen Database

In order to keep this section focused on using CSLA Gen I am going to base my examples on an exceedingly simple database. The schema of this database is shown below.

There is no complexity here at all. Especially since the Users and Roles tables are only there for the purpose of CSLA authentication.

For most of the time it will only be the Person and Child tables that I will be using for my examples. If you wish to follow along with the examples below please create a similar SQL Server database or restore the backup I have included with the handbook.

Note that it is much more correct to think of CSLA classes modelling behaviour rather than data. Indeed we often do not have the luxury of designing a brand new database for our data.

So for the CSLA purists out there (and that includes me) it’s usual to do some object design before cranking out a database design.

However for the sake of simplicity I’m going to skip all of that and pretend that it’s been done and we have a valid object design that has led us to our schema above.

Creating the CSLA Gen Project.

Run CSLA Gen and create a new project called CSLAGenGuide.

Set the project properties as per the table below.

Property
Value

Output Directory

Please set this to anything convenient for yourself.

Database

CSLA Gen

Transaction Type

ADO

Namespace

CSLAGenBasic

Folder

Image:1x1_White.png

General SP Prefix

CSLAGen_

Select Prefix

Fetch_

Insert Prefix

Add_

Update Prefix

Update_

Delete Prefix

Remove_

Open a connection to the CSLAGen database on SQL Server by clicking Image:CSLAGen0010.jpg and entering the following information.

Property
Value

Server

Please set this to the name of your SQL Server instance.

Database

CSLA Gen

Use Integrated Security

If you are using pass through authentication on your SQL Server tick this.

User andPassword

If not using Integrated Security please enter a valid user and password for the CSLAGen database.

At this point you should have a project that is connected to the example schema.

Save the CSLA Gen project to a folder on your machine.


THIS ARTICLE IS YET TO BE COMPLETED BY Chris Denslow


Back to Main Page

Back to Section One - CSLA Gen Overview

Back to Section Two - CSLA Gen Property Reference

Forward to Section Four - Plugins


Personal tools

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