Mercurial > pub > bltoolkit
diff Source/DataAccess/SqlQueryAttribute.cs @ 0:f990fcb411a9
Копия текущей версии из github
author | cin |
---|---|
date | Thu, 27 Mar 2014 21:46:09 +0400 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Source/DataAccess/SqlQueryAttribute.cs Thu Mar 27 21:46:09 2014 +0400 @@ -0,0 +1,46 @@ +using System; + +using BLToolkit.Data; + +namespace BLToolkit.DataAccess +{ + [JetBrains.Annotations.BaseTypeRequired(typeof(DataAccessor))] + [AttributeUsage(AttributeTargets.Method)] + public class SqlQueryAttribute : Attribute + { + public SqlQueryAttribute() + { + } + + public SqlQueryAttribute(string sqlText) + { + _sqlText = sqlText; + } + + private string _sqlText; + public string SqlText + { + get { return _sqlText; } + set { _sqlText = value; } + } + + private bool _isDynamic; + public bool IsDynamic + { + get { return _isDynamic; } + set { _isDynamic = value; } + } + + private int _id = int.MinValue; + public int ID + { + get { return _id; } + set { _id = value; _isDynamic = value != int.MinValue; } + } + + public virtual string GetSqlText(DataAccessor accessor, DbManager dbManager) + { + return _sqlText; + } + } +}