diff --git a/Core/MAX.Core/Caches/ICache.cs b/Core/MAX.Core/Caches/ICache.cs
new file mode 100644
index 0000000..9407565
--- /dev/null
+++ b/Core/MAX.Core/Caches/ICache.cs
@@ -0,0 +1,99 @@
+using System;
+
+namespace MAX.Core.Caches;
+
+///
+/// 缓存
+///
+public interface ICache
+{
+ ///
+ /// 是否存在指定键的缓存
+ ///
+ /// 缓存键
+ bool Exists(string key);
+ ///
+ /// 从缓存中获取数据
+ ///
+ ///
+ ///
+ T Get(string key);
+ ///
+ /// 从缓存中获取数据,如果不存在,则执行获取数据操作并添加到缓存中
+ ///
+ /// 缓存数据类型
+ /// 缓存键
+ /// 获取数据操作
+ T Get(string key, Func func);
+ ///
+ /// 当缓存数据不存在则添加,已存在不会添加,添加成功返回true
+ ///
+ /// 缓存数据类型
+ /// 缓存键
+ /// 值
+ bool TryAdd(string key, T value);
+ ///
+ /// 覆盖添加
+ ///
+ ///
+ ///
+ ///
+ ///
+ bool OverlayAdd(string key, T value);
+ ///
+ /// 移除缓存
+ ///
+ /// 缓存键
+ void Remove(string key);
+ ///
+ /// 清空缓存
+ ///
+ void Clear();
+}
+
+public interface ICache
+{
+ ///
+ /// 是否存在指定键的缓存
+ ///
+ /// 缓存键
+ bool Exists(string key);
+
+ ///
+ /// 从缓存中获取数据,如果不存在,则执行获取数据操作并添加到缓存中
+ ///
+ /// 缓存数据类型
+ /// 缓存键
+ T Get(string key);
+ ///
+ /// 从缓存中获取数据,如果不存在,则执行获取数据操作并添加到缓存中
+ ///
+ /// 缓存数据类型
+ /// 缓存键
+ /// 获取数据操作
+ T Get(string key, Func func);
+ ///
+ /// 当缓存数据不存在则添加,已存在不会添加,添加成功返回true
+ ///
+ /// 缓存数据类型
+ /// 缓存键
+ /// 值
+ bool TryAdd(string key, T value);
+ ///
+ /// 覆盖添加
+ ///
+ ///
+ ///
+ ///
+ ///
+ bool OverlayAdd(string key, T value);
+ ///
+ /// 移除缓存
+ ///
+ /// 缓存键
+ void Remove(string key);
+ ///
+ /// 清空缓存
+ ///
+ void Clear();
+}
diff --git a/Core/MAX.Core/Caches/MemoryCache.cs b/Core/MAX.Core/Caches/MemoryCache.cs
new file mode 100644
index 0000000..b2bc36a
--- /dev/null
+++ b/Core/MAX.Core/Caches/MemoryCache.cs
@@ -0,0 +1,168 @@
+
+using MAX.Core.DependencyInjection;
+using MAX.Core.Infrastructure;
+using System;
+using System.Collections.Concurrent;
+using System.Linq;
+
+namespace MAX.Core.Caches;
+
+///
+/// 内存缓存
+///
+public class MemoryCache : ICache, ISingletonDependency
+{
+ //private static readonly Object _locker = new object();
+ private readonly ConcurrentDictionary _cache = new();
+
+ public virtual void Clear()
+ {
+ _cache.Clear();
+ }
+
+ public virtual bool Exists(string key)
+ {
+ return _cache.ContainsKey(key);
+ }
+ public virtual T Get(string key)
+ {
+ if (Exists(key))
+ {
+ return (T)_cache[key];
+ }
+ return default;
+ }
+ public virtual TResult Get(string key, Func func)
+ {
+ if (Exists(key))
+ {
+ return (TResult)_cache[key];
+ }
+ else
+ {
+ if (func != null)
+ {
+ TResult t = func();
+ TryAdd(key, t);
+ return t;
+ }
+ }
+ return default;
+ }
+
+ public virtual bool OverlayAdd(string key, T value)
+ {
+ if (Exists(key))
+ {
+ _cache[key] = value;
+ }
+ else
+ {
+ _cache.TryAdd(key, value);
+ }
+ return true;
+ }
+
+ public virtual void Remove(string key)
+ {
+ _cache.TryRemove(key, out _);
+ }
+
+ public virtual bool TryAdd(string key, T value)
+ {
+ _cache.AddOrUpdate(key, value, (oldkey, oldvalue) => value);
+ return true;
+ }
+ ///
+ /// 获取所有Key
+ ///
+ ///
+ public string[] AllKeys()
+ {
+ return _cache.Keys.ToArray();
+ }
+}
+///
+/// 单例缓存抽象类
+///
+/// 单例对象
+/// 缓存类型
+public abstract class SingleInstanceLittleCache : SingleInstance, ICache where TModel : class
+{
+ private readonly ConcurrentDictionary _cache = new();
+ ///
+ /// 自定义前缀
+ ///
+ //public abstract string KeyPrefix { get; }
+ //private string FormatKey(string key)
+ //{
+ // return KeyPrefix + key;
+ //}
+
+ public virtual void Clear()
+ {
+ _cache.Clear();
+ }
+
+ public virtual bool Exists(string key)
+ {
+ return _cache.ContainsKey(key);
+ }
+ public virtual TValue Get(string key)
+ {
+ if (Exists(key))
+ {
+ return _cache[key];
+ }
+ return default;
+ }
+ public virtual TValue Get(string key, Func func)
+ {
+ if (Exists(key))
+ {
+ return _cache[key];
+ }
+ else
+ {
+ if (func != null)
+ {
+ TValue t = func();
+ TryAdd(key, t);
+ return t;
+ }
+ }
+ return default;
+ }
+
+ public virtual bool OverlayAdd(string key, TValue value)
+ {
+ if (Exists(key))
+ {
+ _cache[key] = value;
+ }
+ else
+ {
+ _cache.TryAdd(key, value);
+ }
+ return true;
+ }
+
+ public virtual void Remove(string key)
+ {
+ _cache.TryRemove(key, out _);
+ }
+
+ public virtual bool TryAdd(string key, TValue value)
+ {
+ _cache.AddOrUpdate(key, value, (oldkey, oldvalue) => value);
+ return true;
+ }
+ ///
+ /// 获取所有Key
+ ///
+ ///
+ public string[] AllKeys()
+ {
+ return _cache.Keys.ToArray();
+ }
+}
diff --git a/Core/MAX.Core/Commons/CommonValue.cs b/Core/MAX.Core/Commons/CommonValue.cs
new file mode 100644
index 0000000..ddcd731
--- /dev/null
+++ b/Core/MAX.Core/Commons/CommonValue.cs
@@ -0,0 +1,37 @@
+namespace MAX.Core.Commons;
+
+///
+/// 公共Value
+///
+///
+public class CommonValue
+{
+ public CommonValue() { }
+ public CommonValue(TValue value)
+ {
+ Value = value;
+ }
+ public TValue Value { get; set; }
+}
+///
+/// 公共TextValue
+///
+///
+public class CommonTextValue : CommonValue
+{
+ public string Text { get; set; }
+}
+///
+/// 公共TextValue
+///
+public class CommonTextValue : CommonTextValue
+{
+
+}
+///
+/// 默认公共键值对 Key Value
+///
+public class CommonKeyValue : CommonValue
+{
+ public string Key { get; set; }
+}
diff --git a/Core/MAX.Core/Commons/Result.cs b/Core/MAX.Core/Commons/Result.cs
new file mode 100644
index 0000000..5d71941
--- /dev/null
+++ b/Core/MAX.Core/Commons/Result.cs
@@ -0,0 +1,55 @@
+using System;
+
+namespace MAX.Core.Commons;
+
+///
+/// 通用返回
+///
+public class Result
+{
+ ///
+ /// 返回结果是否成功
+ ///
+ public bool Success { get; set; } = false;
+ ///
+ /// 返回消息
+ ///
+ public string Msg { get; set; } = "";
+ ///
+ /// 返回内容
+ ///
+ public object Data { get; set; } = null;
+
+ ///
+ /// 返回状态码
+ ///
+ public int Code { get; set; }
+
+}
+///
+/// 通用返回 指定Data类型
+///
+/// 数据类型
+public class Result : Result
+{
+ ///
+ /// 返回内容
+ ///
+ public new TData Data { get; set; }
+}
+///
+/// 通用返回
+///
+/// 状态类型枚举
+/// 数据类型
+public class Result : Result where TStatus : Enum
+{
+ ///
+ /// 状态
+ ///
+ public TStatus Status { get; set; }
+ ///
+ /// 返回内容
+ ///
+ public new TData Data { get; set; }
+}
diff --git a/Core/MAX.Core/Cryptography/Base64Helper.cs b/Core/MAX.Core/Cryptography/Base64Helper.cs
new file mode 100644
index 0000000..768c732
--- /dev/null
+++ b/Core/MAX.Core/Cryptography/Base64Helper.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Text;
+
+namespace MAX.Core.Cryptography;
+
+public class Base64Helper
+{
+ ///
+ /// Base64加密
+ ///
+ /// 加密采用的编码方式
+ /// 待加密的明文
+ ///
+ public static string Encode(string source, Encoding encode)
+ {
+ string encodeValue = "";
+ byte[] bytes = encode.GetBytes(source);
+ try
+ {
+ encodeValue = Convert.ToBase64String(bytes);
+ }
+ catch
+ {
+ encodeValue = source;
+ }
+ return encodeValue;
+ }
+
+ ///
+ /// Base64加密,采用utf8编码方式加密
+ ///
+ /// 待加密的明文
+ /// 加密后的字符串
+ public static string Encode(string source)
+ {
+ return Encode(source, Encoding.UTF8);
+ }
+
+ ///
+ /// Base64解密
+ ///
+ /// 解密采用的编码方式,注意和加密时采用的方式一致
+ /// 待解密的密文
+ /// 解密后的字符串
+ public static string Decode(string result, Encoding encode)
+ {
+ string decode = "";
+ byte[] bytes = Convert.FromBase64String(result);
+ try
+ {
+ decode = encode.GetString(bytes);
+ }
+ catch
+ {
+ decode = result;
+ }
+ return decode;
+ }
+
+ ///
+ /// Base64解密,采用utf8编码方式解密
+ ///
+ /// 待解密的密文
+ /// 解密后的字符串
+ public static string Decode(string result)
+ {
+ return Decode(result, Encoding.UTF8);
+ }
+}
diff --git a/Core/MAX.Core/Cryptography/DESHelper.cs b/Core/MAX.Core/Cryptography/DESHelper.cs
new file mode 100644
index 0000000..67e37f0
--- /dev/null
+++ b/Core/MAX.Core/Cryptography/DESHelper.cs
@@ -0,0 +1,215 @@
+using System;
+using System.IO;
+using System.Security.Cryptography;
+using System.Text;
+
+namespace MAX.Core.Cryptography;
+
+public sealed class DESHelper
+{
+
+ //默认密钥向量
+ private static readonly byte[] IVKey = { 36, 109, 97, 120, 111, 110, 120, 36 };
+ ///
+ /// DES加密字符串
+ ///
+ /// 待加密的字符串
+ /// 加密密钥,要求为8位
+ /// 加密成功返回加密后的字符串,失败返回源串
+ public static string Encrypt(string encryptString, string encryptKey)
+ {
+ try
+ {
+ encryptKey = GetSubString(encryptKey, 8, "");
+ encryptKey = encryptKey.PadRight(8, ' ');
+ byte[] rgbKey = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 8));
+ byte[] rgbIV = IVKey;
+ byte[] inputByteArray = Encoding.UTF8.GetBytes(encryptString);
+ DES dCSP = DES.Create();
+ MemoryStream mStream = new();
+ CryptoStream cStream = new(mStream, dCSP.CreateEncryptor(rgbKey, rgbIV), CryptoStreamMode.Write);
+ cStream.Write(inputByteArray, 0, inputByteArray.Length);
+ cStream.FlushFinalBlock();
+ return Convert.ToBase64String(mStream.ToArray());
+ }
+ catch
+ {
+ return encryptString;
+ }
+ }
+
+ ///
+ /// DES解密字符串
+ ///
+ /// 待解密的字符串
+ /// 解密密钥,要求为8位,和加密密钥相同
+ /// 解密成功返回解密后的字符串,失败返源串
+ public static string Decrypt(string decryptString, string decryptKey)
+ {
+ try
+ {
+ decryptKey = GetSubString(decryptKey, 0, 8, "");
+ decryptKey = decryptKey.PadRight(8, ' ');
+ byte[] rgbKey = Encoding.UTF8.GetBytes(decryptKey);
+ byte[] rgbIV = IVKey;
+ byte[] inputByteArray = Convert.FromBase64String(decryptString);
+ DES DCSP = DES.Create();
+
+ MemoryStream mStream = new();
+ CryptoStream cStream = new(mStream, DCSP.CreateDecryptor(rgbKey, rgbIV), CryptoStreamMode.Write);
+ cStream.Write(inputByteArray, 0, inputByteArray.Length);
+ cStream.FlushFinalBlock();
+ return Encoding.UTF8.GetString(mStream.ToArray());
+ }
+ catch
+ {
+ return string.Empty;
+ }
+
+ }
+
+ #region 截取字符串函数
+
+ ///
+ /// 截取字符串函数
+ ///
+ /// 所要截取的字符串
+ /// 截取字符串的长度
+ ///
+ public static string GetSubString(string Str, int Num)
+ {
+ if (Str is null or "")
+ {
+ return "";
+ }
+ string outstr = string.Empty;
+ int n = 0;
+ foreach (char ch in Str)
+ {
+ n += Encoding.Default.GetByteCount(ch.ToString());
+
+ if (n > Num)
+ {
+ break;
+ }
+ else
+ {
+ outstr += ch;
+ }
+ }
+
+ return outstr;
+ }
+ ///
+ /// 截取字符串函数,如果超过指定长度则将超出的部分用指定字符串代替
+ ///
+ /// 所要截取的字符串
+ /// 截取字符串的长度
+ /// 截取字符串后省略部分的字符串
+ ///
+ public static string GetSubString(string Str, int Num, string LastStr)
+ {
+ return GetSubString(Str, 0, Num, LastStr);
+ }
+
+ #endregion
+
+ #region 截取字符串,超过部分用指定字符串替换
+
+ /* 宗波于 2010-6-12 日添加, 来源于DiscuzNt */
+ ///
+ /// 取指定长度的字符串
+ ///
+ /// 要检查的字符串
+ /// 起始位置
+ /// 指定长度
+ /// 用于替换的字符串
+ /// 截取后的字符串
+ public static string GetSubString(string p_SrcString, int p_StartIndex, int p_Length, string p_TailString)
+ {
+ string myResult = p_SrcString;
+
+ byte[] bComments = Encoding.UTF8.GetBytes(p_SrcString);
+ foreach (char c in Encoding.UTF8.GetChars(bComments))
+ { //当是日文或韩文时(注:中文的范围:\u4e00 - \u9fa5, 日文在\u0800 - \u4e00, 韩文为\xAC00-\xD7A3)
+ if (c is (> '\u0800' and < '\u4e00') or (> '\xAC00' and < '\xD7A3'))
+ {
+ //if (System.Text.RegularExpressions.Regex.IsMatch(p_SrcString, "[\u0800-\u4e00]+") || System.Text.RegularExpressions.Regex.IsMatch(p_SrcString, "[\xAC00-\xD7A3]+"))
+ //当截取的起始位置超出字段串长度时
+ if (p_StartIndex >= p_SrcString.Length)
+ {
+ return "";
+ }
+ else
+ {
+ return p_SrcString.Substring(p_StartIndex,
+ p_Length + p_StartIndex > p_SrcString.Length ? p_SrcString.Length - p_StartIndex : p_Length);
+ }
+ }
+ }
+
+ if (p_Length >= 0)
+ {
+ byte[] bsSrcString = Encoding.Default.GetBytes(p_SrcString);
+
+ //当字符串长度大于起始位置
+ if (bsSrcString.Length > p_StartIndex)
+ {
+ int p_EndIndex = bsSrcString.Length;
+
+ //当要截取的长度在字符串的有效长度范围内
+ if (bsSrcString.Length > p_StartIndex + p_Length)
+ {
+ p_EndIndex = p_Length + p_StartIndex;
+ }
+ else
+ { //当不在有效范围内时,只取到字符串的结尾
+
+ p_Length = bsSrcString.Length - p_StartIndex;
+ p_TailString = "";
+ }
+
+ int nRealLength = p_Length;
+ int[] anResultFlag = new int[p_Length];
+ byte[] bsResult = null;
+
+ int nFlag = 0;
+ for (int i = p_StartIndex; i < p_EndIndex; i++)
+ {
+ if (bsSrcString[i] > 127)
+ {
+ nFlag++;
+ if (nFlag == 3)
+ {
+ nFlag = 1;
+ }
+ }
+ else
+ {
+ nFlag = 0;
+ }
+
+ anResultFlag[i] = nFlag;
+ }
+
+ if (bsSrcString[p_EndIndex - 1] > 127 && anResultFlag[p_Length - 1] == 1)
+ {
+ nRealLength = p_Length + 1;
+ }
+
+ bsResult = new byte[nRealLength];
+
+ Array.Copy(bsSrcString, p_StartIndex, bsResult, 0, nRealLength);
+
+ myResult = Encoding.Default.GetString(bsResult);
+ myResult += p_TailString;
+ }
+ }
+
+ return myResult;
+ }
+
+
+ #endregion
+
+}
diff --git a/Core/MAX.Core/Cryptography/MD5Helper.cs b/Core/MAX.Core/Cryptography/MD5Helper.cs
new file mode 100644
index 0000000..8397396
--- /dev/null
+++ b/Core/MAX.Core/Cryptography/MD5Helper.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Security.Cryptography;
+using System.Text;
+
+namespace MAX.Core.Cryptography;
+
+public class MD5Helper
+{
+ ///
+ /// MD5加密
+ ///
+ ///
+ ///
+ public static string Md5_32(string instring)
+ {
+ return _Md532(instring);
+ }
+ public static string Md5_Lower32(string instring)
+ {
+ return _Md532(instring, true);
+ }
+ public static string _Md532(string instring, bool IsLower = false)
+ {
+ byte[] result = Encoding.UTF8.GetBytes(string.IsNullOrEmpty(instring) ? "" : instring.Trim());
+ MD5 md5 = MD5.Create();
+ byte[] output = md5.ComputeHash(result);
+ string value = BitConverter.ToString(output).Replace("-", "");
+ if (IsLower)
+ {
+ return value.ToLower();
+ }
+ return value;
+ }
+
+
+ ///
+ /// MD5加密
+ ///
+ ///
+ public static long GetLong(byte[] result)
+ {
+ return
+ Convert.ToInt64(
+ BitConverter.ToString(MD5.Create().ComputeHash(result), 4,
+ 8).Replace("-", ""), 16);
+ }
+
+ ///
+ /// MD5 16位加密转long
+ ///
+ ///
+ ///
+ public static long GetLong(string url)
+ {
+ if (string.IsNullOrEmpty(url))
+ {
+ return 0;
+ }
+
+ return Convert.ToInt64(BitConverter.ToString(MD5.Create().ComputeHash(Encoding.Default.GetBytes(url)), 4, 8).Replace("-", ""), 16);
+ }
+}
diff --git a/Core/MAX.Core/Cryptography/UrlHelper.cs b/Core/MAX.Core/Cryptography/UrlHelper.cs
new file mode 100644
index 0000000..35f2521
--- /dev/null
+++ b/Core/MAX.Core/Cryptography/UrlHelper.cs
@@ -0,0 +1,51 @@
+using System.Text;
+
+namespace MAX.Core.Cryptography;
+
+///
+/// Url 加密 解密
+///
+public class UrlHelper
+{
+ ///
+ /// Url加密
+ ///
+ /// 加密采用的编码方式
+ /// 待加密的明文
+ ///
+ public static string Encode(string source, Encoding encode)
+ {
+ return System.Web.HttpUtility.UrlEncode(source, encode);
+ }
+
+ ///
+ /// Url加密,采用utf8编码方式加密
+ ///
+ /// 待加密的明文
+ /// 加密后的字符串
+ public static string Encode(string source)
+ {
+ return Encode(source, Encoding.UTF8);
+ }
+
+ ///
+ /// Url解密
+ ///
+ /// 解密采用的编码方式,注意和加密时采用的方式一致
+ /// 待解密的密文
+ /// 解密后的字符串
+ public static string Decode(string result, Encoding encode)
+ {
+ return System.Web.HttpUtility.UrlDecode(result, Encoding.UTF8);
+ }
+
+ ///
+ /// Url解密,采用utf8编码方式解密
+ ///
+ /// 待解密的密文
+ /// 解密后的字符串
+ public static string Decode(string result)
+ {
+ return Decode(result, Encoding.UTF8);
+ }
+}
diff --git a/Core/MAX.Core/DependencyInjection/IDependencyRegistrar.cs b/Core/MAX.Core/DependencyInjection/IDependencyRegistrar.cs
new file mode 100644
index 0000000..92cb66b
--- /dev/null
+++ b/Core/MAX.Core/DependencyInjection/IDependencyRegistrar.cs
@@ -0,0 +1,13 @@
+namespace MAX.Core.DependencyInjection;
+
+///
+/// 依赖注册器:把当前模块的服务注册到 。
+/// 底层使用哪个容器由宿主项目决定,MAX.Core 不引用任何容器。
+///
+public interface IDependencyRegistrar
+{
+ ///
+ /// 注册服务
+ ///
+ void Register(IServiceRegistrar registrar);
+}
diff --git a/Core/MAX.Core/DependencyInjection/IScopedDependency.cs b/Core/MAX.Core/DependencyInjection/IScopedDependency.cs
new file mode 100644
index 0000000..eb004ed
--- /dev/null
+++ b/Core/MAX.Core/DependencyInjection/IScopedDependency.cs
@@ -0,0 +1,8 @@
+namespace MAX.Core.DependencyInjection;
+
+///
+/// 作用域(每个 Scope/请求一个实例)
+///
+public interface IScopedDependency
+{
+}
diff --git a/Core/MAX.Core/DependencyInjection/IServiceRegistrar.cs b/Core/MAX.Core/DependencyInjection/IServiceRegistrar.cs
new file mode 100644
index 0000000..d02ba79
--- /dev/null
+++ b/Core/MAX.Core/DependencyInjection/IServiceRegistrar.cs
@@ -0,0 +1,80 @@
+using System;
+
+namespace MAX.Core.DependencyInjection;
+
+///
+/// 依赖注册抽象(由 MAX.Core 自己定义,不依赖任何第三方 DI 容器)。
+/// 具体实现由宿主项目提供,内部适配外部容器(Autofac、Microsoft.Extensions.DependencyInjection 等)。
+///
+public interface IServiceRegistrar
+{
+ ///
+ /// 注册单例: 实现
+ ///
+ void RegisterSingleton() where TService : class where TImplementation : class, TService;
+
+ ///
+ /// 注册单例实例
+ ///
+ void RegisterSingleton(TService instance) where TService : class;
+
+ ///
+ /// 注册单例(匿名工厂)
+ ///
+ void RegisterSingleton(Func factory) where TService : class;
+
+ ///
+ /// 注册单例(key): 实现
+ ///
+ void RegisterSingleton(object? serviceKey) where TService : class where TImplementation : class, TService;
+
+ ///
+ /// 注册单例实例(key)
+ ///
+ void RegisterSingleton(object? serviceKey, TService instance) where TService : class;
+
+ ///
+ /// 注册单例(key + 匿名工厂)
+ ///
+ void RegisterSingleton(object? serviceKey, Func factory) where TService : class;
+
+ ///
+ /// 注册作用域生命周期
+ ///
+ void RegisterScoped() where TService : class where TImplementation : class, TService;
+
+ ///
+ /// 注册作用域生命周期(匿名工厂)
+ ///
+ void RegisterScoped(Func factory) where TService : class;
+
+ ///
+ /// 注册作用域生命周期(key): 实现
+ ///
+ void RegisterScoped(object? serviceKey) where TService : class where TImplementation : class, TService;
+
+ ///
+ /// 注册作用域生命周期(key + 匿名工厂)
+ ///
+ void RegisterScoped(object? serviceKey, Func factory) where TService : class;
+
+ ///
+ /// 注册瞬时生命周期
+ ///
+ void RegisterTransient() where TService : class where TImplementation : class, TService;
+
+ ///
+ /// 注册瞬时生命周期(匿名工厂)
+ ///
+ void RegisterTransient(Func factory) where TService : class;
+
+ ///
+ /// 注册瞬时生命周期(key): 实现
+ ///
+ void RegisterTransient(object? serviceKey) where TService : class where TImplementation : class, TService;
+
+ ///
+ /// 注册瞬时生命周期(key + 匿名工厂)
+ ///
+ void RegisterTransient(object? serviceKey, Func factory) where TService : class;
+}
diff --git a/Core/MAX.Core/DependencyInjection/ISingletonDependency.cs b/Core/MAX.Core/DependencyInjection/ISingletonDependency.cs
new file mode 100644
index 0000000..bcacfcb
--- /dev/null
+++ b/Core/MAX.Core/DependencyInjection/ISingletonDependency.cs
@@ -0,0 +1,8 @@
+namespace MAX.Core.DependencyInjection;
+
+///
+/// 单例
+///
+public interface ISingletonDependency
+{
+}
diff --git a/Core/MAX.Core/DependencyInjection/ITransientDependency.cs b/Core/MAX.Core/DependencyInjection/ITransientDependency.cs
new file mode 100644
index 0000000..3da15a0
--- /dev/null
+++ b/Core/MAX.Core/DependencyInjection/ITransientDependency.cs
@@ -0,0 +1,8 @@
+namespace MAX.Core.DependencyInjection;
+
+///
+/// 每次实例化
+///
+public interface ITransientDependency
+{
+}
diff --git a/Core/MAX.Core/DependencyInjection/LazyServiceProvider.cs b/Core/MAX.Core/DependencyInjection/LazyServiceProvider.cs
new file mode 100644
index 0000000..ccc84dd
--- /dev/null
+++ b/Core/MAX.Core/DependencyInjection/LazyServiceProvider.cs
@@ -0,0 +1,37 @@
+//using MAX.Core.Autofac;
+//using MAX.Core.Infrastructure;
+//using System;
+//using System.Collections.Concurrent;
+
+//namespace MAX.Core.DependencyInjection;
+
+//public interface ILazyServiceProvider
+//{
+// object LazyGetService(Type serviceType);
+// T LazyGetService();
+//}
+
+//public class LazyServiceProvider : SingleInstance, ILazyServiceProvider
+//{
+// protected ConcurrentDictionary> CachedServices { get; }
+// private LazyServiceProvider()
+// {
+// CachedServices = new ConcurrentDictionary>();
+// }
+// public virtual T LazyGetService()
+// {
+// return (T)LazyGetService(typeof(T));
+// }
+
+// public virtual object LazyGetService(Type serviceType)
+// {
+// return GetService(serviceType);
+// }
+// public virtual object GetService(Type serviceType)
+// {
+// return CachedServices.GetOrAdd(
+// serviceType,
+// _ => new Lazy