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.
ConstructorTests.cs
Go to the documentation of this file.
1using System;
2
4{
5 // This should have an error because it doesn't have a public constructor.
7 public class OuterClass
8 : BusinessBase<OuterClass>
9 {
10 private OuterClass() { }
11
12 // This should have an error because it doesn't have a public constructor
13 // (note that it's a nested class).
15 public class NestedClass
16 : BusinessBase<NestedClass>
17 {
18 private NestedClass() { }
19 }
20 }
21
22 // This should have an error because it doesn't have a public constructor
23 // and a warning for the constructor with arguments.
26 : BusinessBase<PrivateConstructorTest>
27 {
28 private PrivateConstructorTest(int x) { }
29 }
30
31 // This should have an error because it has a public constructor
32 // with arguments.
35 : BusinessBase<PublicConstructorWithArgumentsTest>
36 {
38 }
39
40 // This should have an error because it doesn't have a public constructor...
43 : BusinessBase<PrivateConstructorTest>
44 {
45 // ... and I don't want to lose the comment
47 }
48
49 // This should have an error because it doesn't have a public constructor...
52 : BusinessBase<PrivateConstructorTest>
53 {
54 // ... and I don't want to lose the comment
56 }
57
60 : BusinessBase<PublicConstructorExplicitNoArgumentTest>
61 {
63 }
64
67 : BusinessBase<PublicConstructorTest>
68 { }
69}
This is the base class from which most business objects will be derived.
Definition: BusinessBase.cs:38
@ Serializable
Prevents updating or inserting until the transaction is complete.