|
16 | 16 | using System; |
17 | 17 | using System.Linq.Expressions; |
18 | 18 | using System.Reflection; |
19 | | -using MongoDB.Driver.Linq.Linq3Implementation.Misc; |
20 | 19 |
|
21 | 20 | namespace MongoDB.Driver.Linq.Linq3Implementation.Reflection |
22 | 21 | { |
23 | 22 | internal static class ReflectionInfo |
24 | 23 | { |
25 | | - public static ConstructorInfo Constructor<TObject>(Expression<Func<TObject>> lambda) |
26 | | - { |
27 | | - return ExtractConstructorInfoFromLambda(lambda); |
28 | | - } |
| 24 | + public static ConstructorInfo Constructor<TObject>(Expression<Func<TObject>> lambda) => |
| 25 | + ExtractConstructorInfoFromLambda(lambda); |
29 | 26 |
|
30 | | - public static ConstructorInfo Constructor<T1, TObject>(Expression<Func<T1, TObject>> lambda) |
31 | | - { |
32 | | - return ExtractConstructorInfoFromLambda(lambda); |
33 | | - } |
| 27 | + public static ConstructorInfo Constructor<T1, TObject>(Expression<Func<T1, TObject>> lambda) => |
| 28 | + ExtractConstructorInfoFromLambda(lambda); |
34 | 29 |
|
35 | | - public static ConstructorInfo Constructor<T1, T2, TObject>(Expression<Func<T1, T2, TObject>> lambda) |
36 | | - { |
37 | | - return ExtractConstructorInfoFromLambda(lambda); |
38 | | - } |
| 30 | + public static ConstructorInfo Constructor<T1, T2, TObject>(Expression<Func<T1, T2, TObject>> lambda) => |
| 31 | + ExtractConstructorInfoFromLambda(lambda); |
39 | 32 |
|
40 | | - public static ConstructorInfo Constructor<T1, T2, T3, TObject>(Expression<Func<T1, T2, T3, TObject>> lambda) |
41 | | - { |
42 | | - return ExtractConstructorInfoFromLambda(lambda); |
43 | | - } |
| 33 | + public static ConstructorInfo Constructor<T1, T2, T3, TObject>(Expression<Func<T1, T2, T3, TObject>> lambda) => |
| 34 | + ExtractConstructorInfoFromLambda(lambda); |
44 | 35 |
|
45 | | - public static ConstructorInfo Constructor<T1, T2, T3, T4, TObject>(Expression<Func<T1, T2, T3, T4, TObject>> lambda) |
46 | | - { |
47 | | - return ExtractConstructorInfoFromLambda(lambda); |
48 | | - } |
| 36 | + public static ConstructorInfo Constructor<T1, T2, T3, T4, TObject>(Expression<Func<T1, T2, T3, T4, TObject>> lambda) => |
| 37 | + ExtractConstructorInfoFromLambda(lambda); |
49 | 38 |
|
50 | | - public static ConstructorInfo Constructor<T1, T2, T3, T4, T5, TObject>(Expression<Func<T1, T2, T3, T4, T5, TObject>> lambda) |
51 | | - { |
52 | | - return ExtractConstructorInfoFromLambda(lambda); |
53 | | - } |
| 39 | + public static ConstructorInfo Constructor<T1, T2, T3, T4, T5, TObject>(Expression<Func<T1, T2, T3, T4, T5, TObject>> lambda) => |
| 40 | + ExtractConstructorInfoFromLambda(lambda); |
54 | 41 |
|
55 | | - public static ConstructorInfo Constructor<T1, T2, T3, T4, T5, T6, TObject>(Expression<Func<T1, T2, T3, T4, T5, T6, TObject>> lambda) |
56 | | - { |
57 | | - return ExtractConstructorInfoFromLambda(lambda); |
58 | | - } |
| 42 | + public static ConstructorInfo Constructor<T1, T2, T3, T4, T5, T6, TObject>(Expression<Func<T1, T2, T3, T4, T5, T6, TObject>> lambda) => |
| 43 | + ExtractConstructorInfoFromLambda(lambda); |
59 | 44 |
|
60 | | - public static ConstructorInfo Constructor<T1, T2, T3, T4, T5, T6, T7, TObject>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TObject>> lambda) |
61 | | - { |
62 | | - return ExtractConstructorInfoFromLambda(lambda); |
63 | | - } |
| 45 | + public static ConstructorInfo Constructor<T1, T2, T3, T4, T5, T6, T7, TObject>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TObject>> lambda) => |
| 46 | + ExtractConstructorInfoFromLambda(lambda); |
64 | 47 |
|
65 | | - public static MethodInfo Method<T1, TResult>(Expression<Func<T1, TResult>> lambda) |
66 | | - { |
67 | | - return ExtractMethodInfoFromLambda(lambda); |
68 | | - } |
| 48 | + public static MethodInfo Method<TResult>(Expression<Func<TResult>> lambda) => |
| 49 | + ExtractMethodInfoFromLambda(lambda); |
69 | 50 |
|
70 | | - public static MethodInfo Method<T1, T2, TResult>(Expression<Func<T1, T2, TResult>> lambda) |
71 | | - { |
72 | | - return ExtractMethodInfoFromLambda(lambda); |
73 | | - } |
| 51 | + public static MethodInfo Method<T1, TResult>(Expression<Func<T1, TResult>> lambda) => |
| 52 | + ExtractMethodInfoFromLambda(lambda); |
74 | 53 |
|
75 | | - public static MethodInfo Method<T1, T2, T3, TResult>(Expression<Func<T1, T2, T3, TResult>> lambda) |
76 | | - { |
77 | | - return ExtractMethodInfoFromLambda(lambda); |
78 | | - } |
| 54 | + public static MethodInfo Method<T1, T2, TResult>(Expression<Func<T1, T2, TResult>> lambda) => |
| 55 | + ExtractMethodInfoFromLambda(lambda); |
79 | 56 |
|
80 | | - public static MethodInfo Method<T1, T2, T3, T4, TResult>(Expression<Func<T1, T2, T3, T4, TResult>> lambda) |
81 | | - { |
82 | | - return ExtractMethodInfoFromLambda(lambda); |
83 | | - } |
| 57 | + public static MethodInfo Method<T1, T2, T3, TResult>(Expression<Func<T1, T2, T3, TResult>> lambda) => |
| 58 | + ExtractMethodInfoFromLambda(lambda); |
84 | 59 |
|
85 | | - public static MethodInfo Method<T1, T2, T3, T4, T5, TResult>(Expression<Func<T1, T2, T3, T4, T5, TResult>> lambda) |
86 | | - { |
87 | | - return ExtractMethodInfoFromLambda(lambda); |
88 | | - } |
| 60 | + public static MethodInfo Method<T1, T2, T3, T4, TResult>(Expression<Func<T1, T2, T3, T4, TResult>> lambda) => |
| 61 | + ExtractMethodInfoFromLambda(lambda); |
89 | 62 |
|
90 | | - public static MethodInfo Method<T1, T2, T3, T4, T5, T6, TResult>(Expression<Func<T1, T2, T3, T4, T5, T6, TResult>> lambda) |
91 | | - { |
92 | | - return ExtractMethodInfoFromLambda(lambda); |
93 | | - } |
| 63 | + public static MethodInfo Method<T1, T2, T3, T4, T5, TResult>(Expression<Func<T1, T2, T3, T4, T5, TResult>> lambda) => ExtractMethodInfoFromLambda(lambda); |
94 | 64 |
|
95 | | - public static MethodInfo Method<T1, T2, T3, T4, T5, T6, T7, TResult>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TResult>> lambda) |
96 | | - { |
97 | | - return ExtractMethodInfoFromLambda(lambda); |
98 | | - } |
| 65 | + public static MethodInfo Method<T1, T2, T3, T4, T5, T6, TResult>(Expression<Func<T1, T2, T3, T4, T5, T6, TResult>> lambda) => |
| 66 | + ExtractMethodInfoFromLambda(lambda); |
99 | 67 |
|
100 | | - public static MethodInfo Method<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult>> lambda) |
101 | | - { |
102 | | - return ExtractMethodInfoFromLambda(lambda); |
103 | | - } |
| 68 | + public static MethodInfo Method<T1, T2, T3, T4, T5, T6, T7, TResult>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, TResult>> lambda) => |
| 69 | + ExtractMethodInfoFromLambda(lambda); |
104 | 70 |
|
105 | | - public static PropertyInfo Property<TObject, TProperty>(Expression<Func<TObject, TProperty>> lambda) |
106 | | - { |
107 | | - return ExtractPropertyInfoFromLambda(lambda); |
108 | | - } |
| 71 | + public static MethodInfo Method<T1, T2, T3, T4, T5, T6, T7, T8, TResult>(Expression<Func<T1, T2, T3, T4, T5, T6, T7, T8, TResult>> lambda) => |
| 72 | + ExtractMethodInfoFromLambda(lambda); |
109 | 73 |
|
110 | | - public static MethodInfo IndexerGet<TObject, TIndex, TValue>(Expression<Func<TObject, TIndex, TValue>> lambda) |
111 | | - { |
112 | | - return ExtractMethodInfoFromLambda(lambda); |
113 | | - } |
| 74 | + public static PropertyInfo Property<TObject, TProperty>(Expression<Func<TObject, TProperty>> lambda) => |
| 75 | + ExtractPropertyInfoFromLambda(lambda); |
114 | 76 |
|
115 | | - public static MethodInfo IndexerSet<TObject, TIndex, TValue>(Expression<Func<TObject, TIndex, TValue>> lambda) |
116 | | - { |
117 | | - return ExtractIndexerSetMethodInfoFromLambda(lambda); |
118 | | - } |
| 77 | + public static MethodInfo IndexerGet<TObject, TIndex, TValue>(Expression<Func<TObject, TIndex, TValue>> lambda) => |
| 78 | + ExtractMethodInfoFromLambda(lambda); |
| 79 | + |
| 80 | + public static MethodInfo IndexerSet<TObject, TIndex, TValue>(Expression<Func<TObject, TIndex, TValue>> lambda) => |
| 81 | + ExtractIndexerSetMethodInfoFromLambda(lambda); |
119 | 82 |
|
120 | 83 | // private static methods |
121 | 84 | private static ConstructorInfo ExtractConstructorInfoFromLambda(LambdaExpression lambda) |
|
0 commit comments