chore: rename
parent
2dfc2c5d40
commit
b634de675c
|
@ -10,7 +10,7 @@ namespace LeanCloud.Engine {
|
|||
AfterDelete
|
||||
}
|
||||
|
||||
public class LCEngineObjectHookAttribute : Attribute {
|
||||
public class LCEngineClassHookAttribute : Attribute {
|
||||
public string ClassName {
|
||||
get;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace LeanCloud.Engine {
|
|||
get;
|
||||
}
|
||||
|
||||
public LCEngineObjectHookAttribute(string className, LCEngineObjectHookType hookType) {
|
||||
public LCEngineClassHookAttribute(string className, LCEngineObjectHookType hookType) {
|
||||
ClassName = className;
|
||||
HookType = hookType;
|
||||
}
|
|
@ -70,9 +70,9 @@ namespace LeanCloud.Engine {
|
|||
Assembly assembly = Assembly.GetCallingAssembly();
|
||||
ClassHooks = assembly.GetTypes()
|
||||
.SelectMany(t => t.GetMethods())
|
||||
.Where(m => m.GetCustomAttribute<LCEngineObjectHookAttribute>() != null)
|
||||
.Where(m => m.GetCustomAttribute<LCEngineClassHookAttribute>() != null)
|
||||
.ToDictionary(mi => {
|
||||
LCEngineObjectHookAttribute attr = mi.GetCustomAttribute<LCEngineObjectHookAttribute>();
|
||||
LCEngineClassHookAttribute attr = mi.GetCustomAttribute<LCEngineClassHookAttribute>();
|
||||
switch (attr.HookType) {
|
||||
case LCEngineObjectHookType.BeforeSave:
|
||||
return $"{BeforeSave}{attr.ClassName}";
|
||||
|
|
Loading…
Reference in New Issue