6 internal static class IMethodSymbolExtensions
8 internal static bool IsPropertyInfoManagementMethod(
this IMethodSymbol @
this)
10 return @
this !=
null &&
11 ((@this.ContainingType.Name == CslaMemberConstants.Types.BusinessBase &&
12 (@this.Name == CslaMemberConstants.Properties.SetProperty ||
13 @this.Name == CslaMemberConstants.Properties.SetPropertyConvert)) ||
14 ((@this.ContainingType.Name == CslaMemberConstants.Types.BusinessBase ||
15 @this.ContainingType.Name == CslaMemberConstants.Types.ReadOnlyBase) &&
16 (@this.Name == CslaMemberConstants.Properties.GetProperty ||
17 @
this.Name == CslaMemberConstants.Properties.GetPropertyConvert ||
18 @
this.Name == CslaMemberConstants.Properties.LazyGetProperty ||
19 @
this.Name == CslaMemberConstants.Properties.LazyGetPropertyAsync ||
20 @
this.Name == CslaMemberConstants.Properties.LazyReadProperty ||
21 @
this.Name == CslaMemberConstants.Properties.LazyReadPropertyAsync ||
22 @
this.Name == CslaMemberConstants.Properties.LoadPropertyAsync)) ||
23 ((@this.ContainingType.Name == CslaMemberConstants.Types.BusinessBase ||
24 @
this.ContainingType.Name == CslaMemberConstants.Types.ManagedObjectBase) &&
25 @this.Name == CslaMemberConstants.Properties.LoadPropertyMarkDirty) ||
26 ((@this.ContainingType.Name == CslaMemberConstants.Types.BusinessBase ||
27 @
this.ContainingType.Name == CslaMemberConstants.Types.ReadOnlyBase ||
28 @
this.ContainingType.Name == CslaMemberConstants.Types.ManagedObjectBase) &&
29 (@this.Name == CslaMemberConstants.Properties.ReadProperty ||
30 @this.Name == CslaMemberConstants.Properties.ReadPropertyConvert ||
31 @this.Name == CslaMemberConstants.Properties.LoadProperty ||
32 @this.Name == CslaMemberConstants.Properties.LoadPropertyConvert)));
35 internal static DataPortalOperationQualification IsDataPortalOperation(
this IMethodSymbol @
this)
37 return @
this is
null ?
new DataPortalOperationQualification() :
38 @this.IsRootDataPortalOperation().Combine(@this.IsChildDataPortalOperation());
41 internal static DataPortalOperationQualification IsRootDataPortalOperation(
this IMethodSymbol @
this)
45 return new DataPortalOperationQualification();
49 var byNamingConvention =
50 @this.Name == CslaMemberConstants.Operations.DataPortalCreate ||
51 @this.Name == CslaMemberConstants.Operations.DataPortalFetch ||
52 @this.Name == CslaMemberConstants.Operations.DataPortalInsert ||
53 @this.Name == CslaMemberConstants.Operations.DataPortalUpdate ||
54 @this.Name == CslaMemberConstants.Operations.DataPortalDelete ||
55 @this.Name == CslaMemberConstants.Operations.DataPortalDeleteSelf ||
56 @this.Name == CslaMemberConstants.Operations.DataPortalExecute;
57 var byAttribute = @this.GetAttributes().Any(_ => _.AttributeClass.IsDataPortalRootOperationAttribute());
58 return new DataPortalOperationQualification(byNamingConvention, byAttribute);
62 internal static DataPortalOperationQualification IsChildDataPortalOperation(
this IMethodSymbol @
this)
66 return new DataPortalOperationQualification();
70 var byNamingConvention =
71 @this.Name == CslaMemberConstants.Operations.ChildCreate ||
72 @this.Name == CslaMemberConstants.Operations.ChildFetch ||
73 @this.Name == CslaMemberConstants.Operations.ChildInsert ||
74 @this.Name == CslaMemberConstants.Operations.ChildUpdate ||
75 @this.Name == CslaMemberConstants.Operations.ChildDeleteSelf ||
76 @this.Name == CslaMemberConstants.Operations.ChildExecute;
77 var byAttribute = @this.GetAttributes().Any(_ => _.AttributeClass.IsDataPortalChildOperationAttribute());
78 return new DataPortalOperationQualification(byNamingConvention, byAttribute);