SqlFunctionAttribute.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //------------------------------------------------------------------------------
  2. // <copyright file="SqlFunctionAttribute.cs" company="Microsoft Corporation">
  3. // Copyright (c) Microsoft Corporation. All Rights Reserved.
  4. // Information Contained Herein is Proprietary and Confidential.
  5. // </copyright>
  6. // <owner current="true" primary="true">[....]</owner>
  7. // <owner current="true" primary="true">[....]</owner>
  8. // <owner current="true" primary="true">daltudov</owner>
  9. // <owner current="true" primary="true">[....]</owner>
  10. // <owner current="true" primary="false">beysims</owner>
  11. // <owner current="true" primary="false">[....]</owner>
  12. // <owner current="true" primary="false">vadimt</owner>
  13. //------------------------------------------------------------------------------
  14. using System;
  15. namespace Microsoft.SqlServer.Server {
  16. [Serializable]
  17. public enum DataAccessKind {
  18. None = 0,
  19. Read = 1,
  20. }
  21. [Serializable]
  22. public enum SystemDataAccessKind {
  23. None = 0,
  24. Read = 1,
  25. }
  26. // sql specific attribute
  27. [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false), Serializable]
  28. public class SqlFunctionAttribute : System.Attribute {
  29. private bool m_fDeterministic;
  30. private DataAccessKind m_eDataAccess;
  31. private SystemDataAccessKind m_eSystemDataAccess;
  32. private bool m_fPrecise;
  33. private string m_fName;
  34. private string m_fTableDefinition;
  35. private string m_FillRowMethodName;
  36. public SqlFunctionAttribute() {
  37. // default values
  38. m_fDeterministic = false;
  39. m_eDataAccess = DataAccessKind.None;
  40. m_eSystemDataAccess = SystemDataAccessKind.None;
  41. m_fPrecise = false;
  42. m_fName = null;
  43. m_fTableDefinition = null;
  44. m_FillRowMethodName = null;
  45. } // SqlFunctionAttribute
  46. public bool IsDeterministic {
  47. get {
  48. return m_fDeterministic;
  49. }
  50. set {
  51. m_fDeterministic = value;
  52. }
  53. } // Deterministic
  54. public DataAccessKind DataAccess {
  55. get {
  56. return m_eDataAccess;
  57. }
  58. set {
  59. m_eDataAccess = value;
  60. }
  61. } // public bool DataAccessKind
  62. public SystemDataAccessKind SystemDataAccess {
  63. get {
  64. return m_eSystemDataAccess;
  65. }
  66. set {
  67. m_eSystemDataAccess = value;
  68. }
  69. } // public bool SystemDataAccessKind
  70. public bool IsPrecise {
  71. get {
  72. return m_fPrecise;
  73. }
  74. set {
  75. m_fPrecise = value;
  76. }
  77. } // Precise
  78. public string Name {
  79. get {
  80. return m_fName;
  81. }
  82. set {
  83. m_fName = value;
  84. }
  85. }
  86. public string TableDefinition {
  87. get {
  88. return m_fTableDefinition;
  89. }
  90. set {
  91. m_fTableDefinition = value;
  92. }
  93. }
  94. public string FillRowMethodName {
  95. get {
  96. return m_FillRowMethodName;
  97. }
  98. set {
  99. m_FillRowMethodName = value;
  100. }
  101. }
  102. } // class SqlFunctionAttribute
  103. }