1: public class FunctionResult<returnType>
2: {
3:
4: #region Properties
5:
6: #region "ExceptionVal"
7:
8: private Exception _exceptionVal = null;
9: /// <summary>
10: /// Gets or sets the exception val.
11: /// </summary>
12: /// <value>The exception val.</value>
13: public Exception ExceptionVal
14: {
15: get
16: {
17: return this._exceptionVal;
18: }
19: set
20: {
21: this._exceptionVal = value;
22: }
23: }
24:
25: #endregion
26:
27: #region "ReturnVal"
28:
29: private returnType _ReturnVal = null;
30: /// <summary>
31: /// Gets or sets the return val.
32: /// </summary>
33: /// <value>The return val.</value>
34: public returnType ReturnVal
35: {
36: get
37: {
38: return this._ReturnVal;
39: }
40: set
41: {
42: this._ReturnVal = value;
43: }
44: }
45:
46: #endregion
47:
48: #region "ResultType"
49:
50: private FunctionResultTypes _ResultType = null;
51:
52: /// <summary>
53: /// Gets or sets the type of the result.
54: /// </summary>
55: /// <value>The type of the result.</value>
56: public FunctionResultTypes ResultType
57: {
58: get
59: {
60: return this._ResultType;
61: }
62: set
63: {
64: this._ResultType = value;
65: }
66: }
67:
68: #endregion
69: #endregion
70:
71: }
72: #region Supporting Classes
73:
74: /// <summary>
75: /// List of possible errors that can be return from a function result
76: /// </summary>
77:
78: public enum FunctionResultTypes
79: {
80: /// <summary>
81: /// The function result was sucessful.
82: /// </summary>
83: NoErrors = 1,
84:
85: /// <summary>
86: /// The function result encountered validation errors.
87: /// </summary>
88: ValidationErrors = 2,
89:
90: /// <summary>
91: /// The function result encountered unexpected errors.
92: /// </summary>
93: OtherErrors = 3
94:
95: }
96:
97: #endregion