Mercurial > pub > bltoolkit
comparison Source/DataAccess/SqlQueryAttribute.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 | |
| 3 using BLToolkit.Data; | |
| 4 | |
| 5 namespace BLToolkit.DataAccess | |
| 6 { | |
| 7 [JetBrains.Annotations.BaseTypeRequired(typeof(DataAccessor))] | |
| 8 [AttributeUsage(AttributeTargets.Method)] | |
| 9 public class SqlQueryAttribute : Attribute | |
| 10 { | |
| 11 public SqlQueryAttribute() | |
| 12 { | |
| 13 } | |
| 14 | |
| 15 public SqlQueryAttribute(string sqlText) | |
| 16 { | |
| 17 _sqlText = sqlText; | |
| 18 } | |
| 19 | |
| 20 private string _sqlText; | |
| 21 public string SqlText | |
| 22 { | |
| 23 get { return _sqlText; } | |
| 24 set { _sqlText = value; } | |
| 25 } | |
| 26 | |
| 27 private bool _isDynamic; | |
| 28 public bool IsDynamic | |
| 29 { | |
| 30 get { return _isDynamic; } | |
| 31 set { _isDynamic = value; } | |
| 32 } | |
| 33 | |
| 34 private int _id = int.MinValue; | |
| 35 public int ID | |
| 36 { | |
| 37 get { return _id; } | |
| 38 set { _id = value; _isDynamic = value != int.MinValue; } | |
| 39 } | |
| 40 | |
| 41 public virtual string GetSqlText(DataAccessor accessor, DbManager dbManager) | |
| 42 { | |
| 43 return _sqlText; | |
| 44 } | |
| 45 } | |
| 46 } |
