chore: rename

oneRain 2021-03-19 11:18:46 +08:00
parent 2dfc2c5d40
commit b634de675c
2 changed files with 4 additions and 4 deletions

View File

@ -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;
}

View File

@ -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}";