comparison Source/Mapping/Fluent/IFluentMap.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
1 using System;
2 using System.Data;
3
4 using BLToolkit.Reflection.Extension;
5
6 namespace BLToolkit.Mapping.Fluent
7 {
8 /// <summary>
9 /// Interface fluent mapping
10 /// </summary>
11 public interface IFluentMap
12 {
13 /// <summary>
14 /// Get mapping
15 /// </summary>
16 /// <returns></returns>
17 ExtensionList Map();
18
19 /// <summary>
20 /// TableNameAttribute
21 /// </summary>
22 /// <param name="database"></param>
23 /// <param name="owner"></param>
24 /// <param name="name"></param>
25 /// <returns></returns>
26 void TableName(string database, string owner, string name);
27
28 /// <summary>
29 /// Map to ExtensionList
30 /// </summary>
31 /// <param name="extensions"></param>
32 void MapTo(ExtensionList extensions);
33
34 /// <summary>
35 /// Maps the field.
36 /// </summary>
37 /// <param name="propName">Name of the prop.</param>
38 /// <param name="mapName">Name of the map.</param>
39 /// <param name="storage">The storage.</param>
40 /// <param name="isInheritanceDiscriminator">The is inheritance discriminator.</param>
41 /// <returns></returns>
42 void MapField(string propName, string mapName, string storage, bool? isInheritanceDiscriminator);
43
44 /// <summary>
45 /// Primaries the key.
46 /// </summary>
47 /// <param name="propName">Name of the prop.</param>
48 /// <param name="order">The order.</param>
49 void PrimaryKey(string propName, int order);
50
51 /// <summary>
52 /// Nons the updatable.
53 /// </summary>
54 /// <param name="propName">Name of the prop.</param>
55 void NonUpdatable(string propName);
56
57 /// <summary>
58 /// Identities the specified prop name.
59 /// </summary>
60 /// <param name="propName">Name of the prop.</param>
61 void Identity(string propName);
62
63 /// <summary>
64 /// SQLs the ignore.
65 /// </summary>
66 /// <param name="propName">Name of the prop.</param>
67 /// <param name="ignore">if set to <c>true</c> [ignore].</param>
68 void SqlIgnore(string propName, bool ignore);
69
70 /// <summary>
71 /// Maps the ignore.
72 /// </summary>
73 /// <param name="propName">Name of the prop.</param>
74 /// <param name="ignore">if set to <c>true</c> [ignore].</param>
75 void MapIgnore(string propName, bool ignore);
76
77 /// <summary>
78 /// Trimmables the specified prop name.
79 /// </summary>
80 /// <param name="propName">Name of the prop.</param>
81 void Trimmable(string propName);
82
83 /// <summary>
84 /// Maps the value.
85 /// </summary>
86 /// <typeparam name="TR">The type of the R.</typeparam>
87 /// <typeparam name="TV">The type of the V.</typeparam>
88 /// <param name="propName">Name of the prop.</param>
89 /// <param name="origValue">The orig value.</param>
90 /// <param name="value">The value.</param>
91 /// <param name="values">The values.</param>
92 void MapValue<TR, TV>(string propName, TR origValue, TV value, TV[] values);
93
94 /// <summary>
95 /// Maps the value.
96 /// </summary>
97 /// <typeparam name="TV">The type of the V.</typeparam>
98 /// <param name="origValue">The orig value.</param>
99 /// <param name="value">The value.</param>
100 /// <param name="values">The values.</param>
101 void MapValue<TV>(Enum origValue, TV value, TV[] values);
102
103 /// <summary>
104 /// Maps the value.
105 /// </summary>
106 /// <typeparam name="TV">The type of the V.</typeparam>
107 /// <param name="origValue">The orig value.</param>
108 /// <param name="value">The value.</param>
109 /// <param name="values">The values.</param>
110 void MapValue<TV>(object origValue, TV value, TV[] values);
111
112 /// <summary>
113 /// Defauls the value.
114 /// </summary>
115 /// <typeparam name="TR">The type of the R.</typeparam>
116 /// <param name="propName">Name of the prop.</param>
117 /// <param name="value">The value.</param>
118 void DefaulValue<TR>(string propName, TR value);
119
120 /// <summary>
121 /// Defauls the value.
122 /// </summary>
123 /// <typeparam name="TR">The type of the R.</typeparam>
124 /// <param name="propName">Name of the prop.</param>
125 /// <param name="value">The value.</param>
126 void DbType<TR>(string propName, DbType value);
127
128 /// <summary>
129 /// MemberMapper
130 /// </summary>
131 /// <typeparam name="TR">The type of the R.</typeparam>
132 /// <param name="propName">Name of the prop.</param>
133 /// <param name="value">The value.</param>
134 void MemberMapper<TR>(string propName, Type memberType, Type memberMapperType);
135
136 /// <summary>
137 /// Nullables the specified prop name.
138 /// </summary>
139 /// <param name="propName">Name of the prop.</param>
140 /// <param name="isNullable">if set to <c>true</c> [is nullable].</param>
141 void Nullable(string propName, bool isNullable);
142
143 void LazyInstance(string propName, bool isLazy);
144
145 /// <summary>
146 /// Nulls the value.
147 /// </summary>
148 /// <typeparam name="TR">The type of the R.</typeparam>
149 /// <param name="propName">Name of the prop.</param>
150 /// <param name="value">The value.</param>
151 void NullValue<TR>(string propName, TR value);
152
153 /// <summary>
154 /// Associations the specified prop name.
155 /// </summary>
156 /// <param name="propName">Name of the prop.</param>
157 /// <param name="canBeNull">if set to <c>true</c> [can be null].</param>
158 /// <param name="thisKeys">The this keys.</param>
159 /// <param name="otherKeys">The other keys.</param>
160 void Association(string propName, bool canBeNull, string thisKeys, string otherKeys);
161
162 /// <summary>
163 /// Relations the specified prop name.
164 /// </summary>
165 /// <param name="propName">Name of the prop.</param>
166 /// <param name="destinationType">Type of the destination.</param>
167 /// <param name="slaveIndex">Index of the slave.</param>
168 /// <param name="masterIndex">Index of the master.</param>
169 void Relation(string propName, Type destinationType, string[] slaveIndex, string[] masterIndex);
170
171 /// <summary>
172 /// Inheritances the mapping.
173 /// </summary>
174 /// <param name="type">The type.</param>
175 /// <param name="code">The code.</param>
176 /// <param name="isDefault">The is default.</param>
177 void InheritanceMapping(Type type, object code, bool? isDefault);
178 }
179 }