-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathProjectableAttribute.cs
More file actions
42 lines (36 loc) · 1.48 KB
/
ProjectableAttribute.cs
File metadata and controls
42 lines (36 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EntityFrameworkCore.Projectables
{
/// <summary>
/// Declares this property or method to be Projectable.
/// A companion Expression tree will be generated
/// </summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = true, AllowMultiple = false)]
public sealed class ProjectableAttribute : Attribute
{
public ProjectableAttribute() { }
public ProjectableAttribute(string useMemberBody, object memberBodyParameterValue)
{
UseMemberBody = useMemberBody;
MemberBodyParameterValues = new[] { memberBodyParameterValue };
}
public ProjectableAttribute(string useMemberBody, string memberBodyParameterValue) : this(useMemberBody, (object)memberBodyParameterValue) { }
/// <summary>
/// Get or set how null-conditional operators are handeled
/// </summary>
public NullConditionalRewriteSupport NullConditionalRewriteSupport { get; set; }
/// <summary>
/// Get or set from which member to get the expression,
/// or null to get it from the current member.
/// </summary>
public string? UseMemberBody { get; set; }
/// <summary>
/// Parameters values for UseMemberBody.
/// </summary>
public object[]? MemberBodyParameterValues { get; set; }
}
}