DPS907 notes – Tue Oct 29

Various topics today. Programming assignment introduction.

.

Plans for the next week

Today – More web service topics. Programming assignment introduction.

Friday – Test 2.

Next Friday, November 8 – First due date for a part of the programming assignment.

.

Code examples for today

RelationOneToManySelf – shows the best practice way to create a one-to-many relationship with the same class

.

Return and discuss Test 1

Return and discuss Test 1

.

Programming assignment introduction

We’ll introduce and discuss the programming assignment.

.

Topics for today

Using a nullable type in app domain classes… 

You can define a value type property as nullable in an app domain class. Then, the SQL Server database engine will create its table column with the “allow nulls” checked/set to true.

Two syntax forms are available to you. For example, to define a nullable int:

public int? Age { get; set; }

public Nullable<int> { get; set; }

When working with a nullable property (in repository code, for example), it has a useful extension method:

GetValueOrDefault()

.

.

.

.

.

.

.

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: