Mercurial > pub > bltoolkit
comparison Source/Data/Sql/JoinOn.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.Collections.Generic; | |
| 3 using System.Text; | |
| 4 | |
| 5 namespace BLToolkit.Data.Sql | |
| 6 { | |
| 7 using Reflection.Extension; | |
| 8 | |
| 9 public class JoinOn : IQueryElement, ICloneableElement | |
| 10 { | |
| 11 public JoinOn() | |
| 12 { | |
| 13 } | |
| 14 | |
| 15 public JoinOn(string field, string otherField) | |
| 16 { | |
| 17 _field = field; | |
| 18 _otherField = otherField; | |
| 19 } | |
| 20 | |
| 21 public JoinOn(string field, string otherField, string expression) | |
| 22 { | |
| 23 _field = field; | |
| 24 _otherField = otherField; | |
| 25 _expression = expression; | |
| 26 } | |
| 27 | |
| 28 public JoinOn(AttributeExtension ext) | |
| 29 { | |
| 30 _field = (string)ext["Field"]; | |
| 31 _otherField = (string)ext["OtherField"]; | |
| 32 _expression = (string)ext["Expression"]; | |
| 33 } | |
| 34 | |
| 35 private string _field; | |
| 36 public string Field { get { return _field; } set { _field = value; } } | |
| 37 | |
| 38 private string _otherField; | |
| 39 public string OtherField { get { return _otherField; } set { _otherField = value; } } | |
| 40 | |
| 41 private string _expression; | |
| 42 public string Expression { get { return _expression; } set { _expression = value; } } | |
| 43 | |
| 44 #region IQueryElement Members | |
| 45 | |
| 46 public QueryElementType ElementType { get { return QueryElementType.JoinOn; } } | |
| 47 | |
| 48 StringBuilder IQueryElement.ToString(StringBuilder sb, Dictionary<IQueryElement,IQueryElement> dic) | |
| 49 { | |
| 50 return sb; | |
| 51 } | |
| 52 | |
| 53 #endregion | |
| 54 | |
| 55 #region ICloneableElement Members | |
| 56 | |
| 57 public ICloneableElement Clone(Dictionary<ICloneableElement, ICloneableElement> objectTree, Predicate<ICloneableElement> doClone) | |
| 58 { | |
| 59 if (!doClone(this)) | |
| 60 return this; | |
| 61 | |
| 62 ICloneableElement clone; | |
| 63 | |
| 64 if (!objectTree.TryGetValue(this, out clone)) | |
| 65 objectTree.Add(this, clone = new JoinOn(_field, _otherField, _expression)); | |
| 66 | |
| 67 return clone; | |
| 68 } | |
| 69 | |
| 70 #endregion | |
| 71 } | |
| 72 } |
