diff --git a/Engine/Attributes/LCEngineClassHookAttribute.cs b/Engine/Attributes/LCEngineClassHookAttribute.cs index a3e0a5d..6fbe6d8 100644 --- a/Engine/Attributes/LCEngineClassHookAttribute.cs +++ b/Engine/Attributes/LCEngineClassHookAttribute.cs @@ -20,6 +20,9 @@ namespace LeanCloud.Engine { } public LCEngineClassHookAttribute(string className, LCEngineObjectHookType hookType) { + if (string.IsNullOrEmpty(className)) { + throw new ArgumentNullException(nameof(className)); + } ClassName = className; HookType = hookType; } diff --git a/Engine/LCEngine.cs b/Engine/LCEngine.cs index 7b7b074..2bf6050 100644 --- a/Engine/LCEngine.cs +++ b/Engine/LCEngine.cs @@ -9,7 +9,6 @@ using Newtonsoft.Json; using Microsoft.Extensions.Primitives; using Microsoft.Extensions.DependencyInjection; using LeanCloud.Common; -using LeanCloud.Storage; namespace LeanCloud.Engine { public class LCEngine { diff --git a/Engine/LCEngineRequestContext.cs b/Engine/LCEngineRequestContext.cs index 1eb7d8b..c04c2f9 100644 --- a/Engine/LCEngineRequestContext.cs +++ b/Engine/LCEngineRequestContext.cs @@ -5,9 +5,9 @@ using LeanCloud.Storage; namespace LeanCloud.Engine { public class LCEngineRequestContext { - public const string RemoteAddressKey = "remoteAddressKey"; - public const string SessionTokenKey = "sessionToken"; - public const string CurrentUserKey = "currentUser"; + public const string RemoteAddressKey = "__remoteAddressKey"; + public const string SessionTokenKey = "__sessionToken"; + public const string CurrentUserKey = "__currentUser"; private static ThreadLocal> requestContext = new ThreadLocal>();