0
|
1 using System;
|
|
2
|
|
3 namespace BLToolkit.Data.DataProvider
|
|
4 {
|
|
5 public enum ConvertType
|
|
6 {
|
|
7 /// <summary>
|
|
8 /// Provided name should be converted to query parameter name.
|
|
9 /// For example:
|
|
10 /// firstName -> @firstName
|
|
11 /// for the following query:
|
|
12 /// SELECT * FROM Person WHERE FirstName = @firstName
|
|
13 /// ^ here
|
|
14 /// </summary>
|
|
15 NameToQueryParameter,
|
|
16
|
|
17 /// <summary>
|
|
18 /// Provided name should be converted to command parameter name.
|
|
19 /// For example:
|
|
20 /// firstName -> @firstName
|
|
21 /// for the following query:
|
|
22 /// db.Parameter("@firstName") = "John";
|
|
23 /// ^ here
|
|
24 /// </summary>
|
|
25 NameToCommandParameter,
|
|
26
|
|
27 [Obsolete("Use NameToCommandParameter or NameToSprocParameter instead.")]
|
|
28 NameToParameter = NameToCommandParameter,
|
|
29
|
|
30 /// <summary>
|
|
31 /// Provided name should be converted to stored procedure parameter name.
|
|
32 /// For example:
|
|
33 /// firstName -> @firstName
|
|
34 /// for the following query:
|
|
35 /// db.Parameter("@firstName") = "John";
|
|
36 /// ^ here
|
|
37 /// </summary>
|
|
38 NameToSprocParameter,
|
|
39
|
|
40 /// <summary>
|
|
41 /// Provided name should be converted to query field name.
|
|
42 /// For example:
|
|
43 /// FirstName -> [FirstName]
|
|
44 /// for the following query:
|
|
45 /// SELECT [FirstName] FROM Person WHERE ID = 1
|
|
46 /// ^ and ^
|
|
47 /// </summary>
|
|
48 NameToQueryField,
|
|
49
|
|
50 /// <summary>
|
|
51 /// Provided name should be converted to query field alias.
|
|
52 /// For example:
|
|
53 /// ID -> "ID"
|
|
54 /// for the following query:
|
|
55 /// SELECT "ID" as "ID" FROM Person WHERE "ID" = 1
|
|
56 /// ^ ^ here
|
|
57 /// </summary>
|
|
58 NameToQueryFieldAlias,
|
|
59
|
|
60 /// <summary>
|
|
61 /// Provided name should be converted to query database.
|
|
62 /// For example:
|
|
63 /// MyDatabase -> [MyDatabase]
|
|
64 /// for the following query:
|
|
65 /// SELECT * FROM [MyDatabase]..[Person]
|
|
66 /// ^ and ^
|
|
67 /// </summary>
|
|
68 NameToDatabase,
|
|
69
|
|
70 /// <summary>
|
|
71 /// Provided name should be converted to query database.
|
|
72 /// For example:
|
|
73 /// dbo -> [dbo]
|
|
74 /// for the following query:
|
|
75 /// SELECT * FROM [ dbo ].[Person]
|
|
76 /// ^ and ^
|
|
77 /// </summary>
|
|
78 NameToOwner,
|
|
79
|
|
80 /// <summary>
|
|
81 /// Provided name should be converted to query table name.
|
|
82 /// For example:
|
|
83 /// Person -> [Person]
|
|
84 /// for the following query:
|
|
85 /// SELECT * FROM [Person]
|
|
86 /// ^ and ^
|
|
87 /// </summary>
|
|
88 NameToQueryTable,
|
|
89
|
|
90 /// <summary>
|
|
91 /// Provided name should be converted to query table alias.
|
|
92 /// For example:
|
|
93 /// table1 -> [table1]
|
|
94 /// for the following query:
|
|
95 /// SELECT * FROM [Person] [table1]
|
|
96 /// ^ and ^
|
|
97 /// </summary>
|
|
98 NameToQueryTableAlias,
|
|
99
|
|
100 /// <summary>
|
|
101 /// Provided stored procedure parameter name should be converted to name.
|
|
102 /// For example:
|
|
103 /// @firstName -> firstName
|
|
104 /// for the following query:
|
|
105 /// db.Parameter("@firstName") = "John";
|
|
106 /// ^ '@' has to be removed
|
|
107 /// </summary>
|
|
108 SprocParameterToName,
|
|
109
|
|
110 [Obsolete("Use SprocParameterToName instead.")]
|
|
111 ParameterToName = SprocParameterToName,
|
|
112
|
|
113 /// <summary>
|
|
114 /// Gets error number from a native exception.
|
|
115 /// For example:
|
|
116 /// SqlException -> SqlException.Number,
|
|
117 /// OleDbException -> OleDbException.Errors[0].NativeError
|
|
118 /// </summary>
|
|
119 ExceptionToErrorNumber,
|
|
120
|
|
121 /// <summary>
|
|
122 /// Gets error message from a native exception.
|
|
123 /// For example:
|
|
124 /// SqlException -> SqlException.Message,
|
|
125 /// OleDbException -> OleDbException.Errors[0].Message
|
|
126 /// </summary>
|
|
127 ExceptionToErrorMessage,
|
|
128 }
|
|
129 }
|