From 673500e2be960f5bb874477120ab5b46f41caa30 Mon Sep 17 00:00:00 2001 From: oneRain Date: Thu, 25 Mar 2021 10:46:03 +0800 Subject: [PATCH] chore --- Engine/Attributes/LCEngineClassHookAttribute.cs | 3 +++ Engine/LCEngine.cs | 1 - Engine/LCEngineRequestContext.cs | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) 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>();