comparison Source/Data/Linq/SqlPropertyAttribute.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.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 }