From a9a592463d6211a70b3d7e88e770455f1a5ef242 Mon Sep 17 00:00:00 2001
From: FalconFly <12919280+falconfly@user.noreply.gitee.com>
Date: Thu, 16 Nov 2023 12:07:46 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=99=A8=E5=9F=BA=E7=B1=BB?=
=?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E9=9D=9E=E5=BF=85=E9=80=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
Falcon.SugarApi/ApiDefinistions/ApiControllerBase.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Falcon.SugarApi/ApiDefinistions/ApiControllerBase.cs b/Falcon.SugarApi/ApiDefinistions/ApiControllerBase.cs
index a8e3e1c..0a5deee 100644
--- a/Falcon.SugarApi/ApiDefinistions/ApiControllerBase.cs
+++ b/Falcon.SugarApi/ApiDefinistions/ApiControllerBase.cs
@@ -35,7 +35,7 @@ namespace Falcon.SugarApi.ApiDefinistions
///
/// Sugar数据库
///
- public SugarDbContext SugarDb { get; set; }
+ public SugarDbContext? SugarDb { get; set; }
///
/// 应用程序跟目录
@@ -59,7 +59,7 @@ namespace Falcon.SugarApi.ApiDefinistions
protected ApiControllerBase(IServiceProvider service) {
this.Services = service;
this.Logger = service.GetService(typeof(ILogger<>).MakeGenericType(GetType())) as ILogger ?? throw new NullReferenceException("ILogger");
- this.SugarDb = service.GetService() ?? throw new NullReferenceException("SugarDbContext");
+ this.SugarDb = service.GetService();
this.Cache = service.GetService();
}