改造null
This commit is contained in:
@@ -11,7 +11,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
{
|
||||
public static class SqlsugarExtension
|
||||
{
|
||||
public static void AddSqlsugarServer(this IServiceCollection services, Action<SqlSugarClient> action = null)
|
||||
public static void AddSqlsugarServer(this IServiceCollection services, Action<SqlSugarClient>? action = null)
|
||||
{
|
||||
DbType dbType;
|
||||
var slavaConFig = new List<SlaveConnectionConfig>();
|
||||
@@ -60,7 +60,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
},
|
||||
db =>
|
||||
{
|
||||
if (action.IsNotNull())
|
||||
if (action is not null)
|
||||
{
|
||||
action(db);
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
{
|
||||
if (this._supportDelete && "Delete".Equals(context.Request.Query["ActionHeader"]))
|
||||
{
|
||||
this.DeleteHmtl(context.Request.Path.Value);
|
||||
this.DeleteHmtl(context.Request.Path.Value??"");
|
||||
context.Response.StatusCode = 200;
|
||||
}
|
||||
else if (this._supportWarmup && "ClearAll".Equals(context.Request.Query["ActionHeader"]))
|
||||
@@ -52,7 +52,7 @@ namespace Yi.Framework.WebCore.MiddlewareExtend
|
||||
copyStream.Position = 0;
|
||||
var reader = new StreamReader(copyStream);
|
||||
var content = await reader.ReadToEndAsync();
|
||||
string url = context.Request.Path.Value;
|
||||
string url = context.Request.Path.Value??"";
|
||||
|
||||
this.SaveHmtl(url, content);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user