From b634de675cdd95d8fcab4f8758a94649fe4580cc Mon Sep 17 00:00:00 2001 From: oneRain Date: Fri, 19 Mar 2021 11:18:46 +0800 Subject: [PATCH] chore: rename --- ...neObjectHookAttribute.cs => LCEngineClassHookAttribute.cs} | 4 ++-- Engine/LCEngine.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) rename Engine/Attributes/{LCEngineObjectHookAttribute.cs => LCEngineClassHookAttribute.cs} (74%) diff --git a/Engine/Attributes/LCEngineObjectHookAttribute.cs b/Engine/Attributes/LCEngineClassHookAttribute.cs similarity index 74% rename from Engine/Attributes/LCEngineObjectHookAttribute.cs rename to Engine/Attributes/LCEngineClassHookAttribute.cs index 44305bc..a3e0a5d 100644 --- a/Engine/Attributes/LCEngineObjectHookAttribute.cs +++ b/Engine/Attributes/LCEngineClassHookAttribute.cs @@ -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; } diff --git a/Engine/LCEngine.cs b/Engine/LCEngine.cs index 554047e..98174e7 100644 --- a/Engine/LCEngine.cs +++ b/Engine/LCEngine.cs @@ -70,9 +70,9 @@ namespace LeanCloud.Engine { Assembly assembly = Assembly.GetCallingAssembly(); ClassHooks = assembly.GetTypes() .SelectMany(t => t.GetMethods()) - .Where(m => m.GetCustomAttribute() != null) + .Where(m => m.GetCustomAttribute() != null) .ToDictionary(mi => { - LCEngineObjectHookAttribute attr = mi.GetCustomAttribute(); + LCEngineClassHookAttribute attr = mi.GetCustomAttribute(); switch (attr.HookType) { case LCEngineObjectHookType.BeforeSave: return $"{BeforeSave}{attr.ClassName}";