annotate Source/Mapping/Fluent/AssociationMap.cs @ 9:1e85f66cf767 default tip

update bltoolkit
author nickolay
date Thu, 05 Apr 2018 20:53:26 +0300
parents f990fcb411a9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
1 using System;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
2 using System.Collections.Generic;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
3 using System.Linq.Expressions;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
4
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
5 namespace BLToolkit.Mapping.Fluent
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
6 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
7 public partial class MapFieldMap<T, TR>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
8 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
9 public class AssociationMap<TRt>
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
10 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
11 private readonly MapFieldMap<T, TR> _owner;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
12 private readonly bool _canBeNull;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
13 private readonly List<Expression<Func<T, TRt>>> _thisKeys;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
14
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
15 public AssociationMap(MapFieldMap<T, TR> owner, bool canBeNull, List<Expression<Func<T, TRt>>> thisKeys)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
16 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
17 this._owner = owner;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
18 this._canBeNull = canBeNull;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
19 this._thisKeys = thisKeys;
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
20 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
21
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
22 public MapFieldMap<T, TR> ToMany<TRf, TRo>(Expression<Func<TRf, TRo>> otherKey, params Expression<Func<TRf, TRo>>[] otherKeys)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
23 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
24 var keys = new List<Expression<Func<TRf, TRo>>>(otherKeys);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
25 keys.Insert(0, otherKey);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
26 return this._owner.Association(this._canBeNull, this._thisKeys, keys);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
27 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
28
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
29 public MapFieldMap<T, TR> ToOne<TRo>(Expression<Func<TR, TRo>> otherKey, params Expression<Func<TR, TRo>>[] otherKeys)
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
30 {
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
31 var keys = new List<Expression<Func<TR, TRo>>>(otherKeys);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
32 keys.Insert(0, otherKey);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
33 return this._owner.Association(this._canBeNull, this._thisKeys, keys);
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
34 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
35 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
36 }
f990fcb411a9 Копия текущей версии из github
cin
parents:
diff changeset
37 }