CSLA.NET
6.0.0
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
NullableEntity.cs
Go to the documentation of this file.
1
using
System;
2
using
System.Collections.Generic;
3
using
System.Text;
4
5
namespace
Csla.Ios.Test
6
{
7
[
Serializable
()]
8
public
class
NullableEntity
:
BusinessBase
<NullableEntity>
9
{
10
public
static
readonly
PropertyInfo<string>
NameProperty
= RegisterProperty<string>(c => c.Name);
11
12
public
string
Name
13
{
14
get
{
return
GetProperty(
NameProperty
); }
15
set
{ SetProperty(
NameProperty
, value); }
16
}
17
18
public
static
readonly
PropertyInfo<int?>
NullableIntegerProperty
= RegisterProperty<int?>(c => c.NullableInteger);
19
20
public
int
?
NullableInteger
21
{
22
get
{
return
GetProperty(
NullableIntegerProperty
); }
23
set
{ SetProperty(
NullableIntegerProperty
, value); }
24
}
25
26
#region Rules
27
28
protected
override
void
AddBusinessRules
()
29
{
30
base.AddBusinessRules();
31
32
//Name
33
BusinessRules.AddRule(
new
ClearRule(
NameProperty
,
NullableIntegerProperty
));
34
}
35
36
private
class
ClearRule :
Csla
.Rules.PropertyRule
37
{
38
39
private
Csla
.
Core
.
IPropertyInfo
_clearProperty;
40
41
public
ClearRule(
Csla
.
Core
.
IPropertyInfo
primaryProperty,
Csla
.
Core
.
IPropertyInfo
clearProperty)
42
: base(primaryProperty)
43
{
44
_clearProperty = clearProperty;
45
InputProperties =
new
List<
Csla
.
Core
.
IPropertyInfo
> { primaryProperty };
46
AffectedProperties.Add(_clearProperty);
47
}
48
49
protected
override
void
Execute
(
Csla
.
Rules
.
IRuleContext
context)
50
{
51
var input = (string)context.InputPropertyValues[PrimaryProperty];
52
if (
string
.IsNullOrEmpty(input))
53
{
54
context.AddOutValue(_clearProperty,
null
);
55
}
56
}
57
}
58
59
#endregion
60
61
public
static
NullableEntity
NewNullableEntity
()
62
{
63
return
Csla
.
DataPortal
.
Create
<
NullableEntity
>();
64
}
65
66
protected
override
void
DataPortal_Create
()
67
{
68
Csla
.
ApplicationContext
.GlobalContext.Add(
"NullableObject"
,
"Created"
);
69
}
70
}
71
}
Csla.ApplicationContext
Provides consistent context information between the client and server DataPortal objects.
Definition:
ApplicationContext.cs:22
Csla.BusinessBase
This is the base class from which most business objects will be derived.
Definition:
BusinessBase.cs:38
Csla.DataPortal
Client side data portal used for making asynchronous data portal calls in .NET.
Definition:
DataPortalT.cs:24
Csla.DataPortal.Create
T Create(params object[] criteria)
Called by a factory method in a business class to create a new object, which is loaded with default v...
Definition:
DataPortalT.cs:151
Csla.Ios.Test.NullableEntity
Definition:
NullableEntity.cs:9
Csla.Ios.Test.NullableEntity.DataPortal_Create
override void DataPortal_Create()
Definition:
NullableEntity.cs:66
Csla.Ios.Test.NullableEntity.Name
string Name
Definition:
NullableEntity.cs:13
Csla.Ios.Test.NullableEntity.NameProperty
static readonly PropertyInfo< string > NameProperty
Definition:
NullableEntity.cs:10
Csla.Ios.Test.NullableEntity.AddBusinessRules
override void AddBusinessRules()
Definition:
NullableEntity.cs:28
Csla.Ios.Test.NullableEntity.NullableIntegerProperty
static readonly PropertyInfo< int?> NullableIntegerProperty
Definition:
NullableEntity.cs:18
Csla.Ios.Test.NullableEntity.NewNullableEntity
static NullableEntity NewNullableEntity()
Definition:
NullableEntity.cs:61
Csla.Ios.Test.NullableEntity.NullableInteger
int? NullableInteger
Definition:
NullableEntity.cs:21
Csla.PropertyInfo
Maintains metadata about a property.
Definition:
Csla/PropertyInfo.cs:22
Csla.Core.IPropertyInfo
Maintains metadata about a property.
Definition:
Csla/Core/IPropertyInfo.cs:16
Csla.Rules.IRuleContext
Context information provided to a business rule when it is invoked.
Definition:
IRuleContext.cs:22
Csla.Core
Definition:
AddedNewEventArgs.cs:11
Csla.Ios.Test
Definition:
Main.cs:9
Csla.Rules
Definition:
AddObjectAuthorizationRulesContext.cs:11
Csla
Definition:
BusinessRuleCases.cs:5
Csla.TransactionIsolationLevel.Serializable
@ Serializable
Prevents updating or inserting until the transaction is complete.
Csla.DataPortalOperations.Execute
@ Execute
Execute operation.
Generated by
1.9.2