0
|
1 using System;
|
|
2 using System.Reflection;
|
|
3 using BLToolkit.Reflection;
|
|
4
|
|
5 namespace BLToolkit.Data.Linq
|
|
6 {
|
|
7 using Data.Sql;
|
|
8
|
|
9 [SerializableAttribute]
|
|
10 [AttributeUsageAttribute(AttributeTargets.Property | AttributeTargets.Method, AllowMultiple = true, Inherited = false)]
|
|
11 public class SqlPropertyAttribute : SqlFunctionAttribute
|
|
12 {
|
|
13 public SqlPropertyAttribute()
|
|
14 {
|
|
15 }
|
|
16
|
|
17 public SqlPropertyAttribute(string name)
|
|
18 : base(name)
|
|
19 {
|
|
20 }
|
|
21
|
|
22 public SqlPropertyAttribute(string sqlProvider, string name)
|
|
23 : base(sqlProvider, name)
|
|
24 {
|
|
25 }
|
|
26
|
|
27 public override ISqlExpression GetExpression(MemberInfo member, params ISqlExpression[] args)
|
|
28 {
|
|
29 return new SqlExpression(TypeHelper.GetMemberType(member), Name ?? member.Name, Precedence.Primary);
|
|
30 }
|
|
31 }
|
|
32 }
|