Skip to content

Commit

Permalink
Merge branch 'dev/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
gmf520 committed Sep 24, 2024
2 parents daac4ce + 24551ae commit df750b7
Show file tree
Hide file tree
Showing 59 changed files with 451 additions and 264 deletions.
22 changes: 11 additions & 11 deletions build/OSharpNS.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>OSharpNS</id>
<version>6.0.10-preview.1021</version>
<version>8.0.9</version>
<title>OSharpFramework(.NET6.0/.NETCoreApp3.1)</title>
<authors>柳柳软件(66soft.net)</authors>
<owners>LiuliuSoft nnc</owners>
Expand All @@ -16,18 +16,18 @@
<tags>osharp</tags>
<dependencies>
<group targetFramework=".NETCoreApp3.1">
<dependency id="OSharp.Core" version="6.0.10-preview.1021" />
<dependency id="OSharp.EntityFrameworkCore" version="6.0.10-preview.1021" />
<dependency id="OSharp.AutoMapper" version="6.0.10-preview.1021" />
<dependency id="OSharp.AspNetCore" version="6.0.10-preview.1021" />
<dependency id="OSharp.Log4Net" version="6.0.10-preview.1021" />
<dependency id="OSharp.Core" version="8.0.9" />
<dependency id="OSharp.EntityFrameworkCore" version="8.0.9" />
<dependency id="OSharp.AutoMapper" version="8.0.9" />
<dependency id="OSharp.AspNetCore" version="8.0.9" />
<dependency id="OSharp.Log4Net" version="8.0.9" />
</group>
<group targetFramework="net6.0">
<dependency id="OSharp.Core" version="6.0.10-preview.1021" />
<dependency id="OSharp.EntityFrameworkCore" version="6.0.10-preview.1021" />
<dependency id="OSharp.AutoMapper" version="6.0.10-preview.1021" />
<dependency id="OSharp.AspNetCore" version="6.0.10-preview.1021" />
<dependency id="OSharp.Log4Net" version="6.0.10-preview.1021" />
<dependency id="OSharp.Core" version="8.0.9" />
<dependency id="OSharp.EntityFrameworkCore" version="8.0.9" />
<dependency id="OSharp.AutoMapper" version="8.0.9" />
<dependency id="OSharp.AspNetCore" version="8.0.9" />
<dependency id="OSharp.Log4Net" version="8.0.9" />
</group>
</dependencies>
</metadata>
Expand Down
12 changes: 6 additions & 6 deletions build/version.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project>
<PropertyGroup>
<VersionMain>8.0</VersionMain>
<VersionPrefix>1</VersionPrefix>
<VersionPrefix>9</VersionPrefix>
<VersionSuffix>-preview.</VersionSuffix>
<VersionSuffixVersion>113</VersionSuffixVersion>
<Version>$(VersionMain).$(VersionPrefix)$(VersionSuffix)$(VersionSuffixVersion)</Version>
<FileVersion>$(VersionMain).$(VersionPrefix).$(VersionSuffixVersion)</FileVersion>
<!--<Version>$(VersionMain).$(VersionPrefix)</Version>
<FileVersion>$(VersionMain).$(VersionPrefix)</FileVersion>-->
<VersionSuffixVersion>529</VersionSuffixVersion>
<!--<Version>$(VersionMain).$(VersionPrefix)$(VersionSuffix)$(VersionSuffixVersion)</Version>
<FileVersion>$(VersionMain).$(VersionPrefix).$(VersionSuffixVersion)</FileVersion>-->
<Version>$(VersionMain).$(VersionPrefix)</Version>
<FileVersion>$(VersionMain).$(VersionPrefix)</FileVersion>
</PropertyGroup>
</Project>
11 changes: 7 additions & 4 deletions osharp.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@
<s:String x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/SIMPLE_EMBEDDED_STATEMENT_STYLE/@EntryValue">LINE_BREAK</s:String>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/STICK_COMMENT/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/FileHeader/FileHeaderText/@EntryValue">-----------------------------------------------------------------------&#xD;
&lt;copyright file="$FILENAME$" company="OSharp开源团队"&gt;&#xD;
Copyright (c) 2014-$CURRENT_YEAR$ OSharp. All rights reserved.&#xD;
&lt;copyright file="${File.FileName}" company="OSharp开源团队"&gt;&#xD;
Copyright (c) 2014-${CurrentDate.Year} OSharp. All rights reserved.&#xD;
&lt;/copyright&gt;&#xD;
&lt;site&gt;http://www.osharp.org&lt;/site&gt;&#xD;
&lt;last-editor&gt;$USER_NAME$&lt;/last-editor&gt;&#xD;
&lt;last-date&gt;$CURRENT_YEAR$-$CURRENT_MONTH$-$CURRENT_DAY$ $CURRENT_TIME$&lt;/last-date&gt;&#xD;
&lt;last-editor&gt;${User.Name}&lt;/last-editor&gt;&#xD;
&lt;last-date&gt;${CurrentDate.Year}-${CurrentDate.Month}-${CurrentDate.Day} ${CurrentDate.Hour}:${CurrentDate.Minute}&lt;/last-date&gt;&#xD;
-----------------------------------------------------------------------</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DBC/@EntryIndexedValue">DBC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=DI/@EntryIndexedValue">DI</s:String>
Expand All @@ -114,6 +114,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SBC/@EntryIndexedValue">SBC</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TB/@EntryIndexedValue">TB</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticReadonly/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=15b5b1f1_002D457c_002D4ca6_002Db278_002D5615aedc07d3/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static readonly fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="_" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FCONSTANT/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FFUNCTION/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FVARIABLE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
Expand Down Expand Up @@ -163,6 +164,7 @@
<s:Boolean x:Key="/Default/Environment/ParameterNameHintsOptions/ShowParameterNameHints/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/Environment/PerformanceGuide/SwitchBehaviour/=VCS/@EntryIndexedValue">LIVE_MONITOR</s:String>
<s:String x:Key="/Default/Environment/PerformanceGuide/SwitchConflictResolutionMode/=VCS/@EntryIndexedValue">NOTIFY</s:String>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECodeCleanup_002EFileHeader_002EFileHeaderSettingsMigrate/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECSharp_002EParameterNameHints_002ECSharpParameterNameHintsOptionsMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002EInlayHints_002EInlayHintsOptionsMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002EVB_002EParameterNameHints_002EVBParameterNameHintsOptionsMigration/@EntryIndexedValue">True</s:Boolean>
Expand All @@ -175,6 +177,7 @@
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsParsFormattingSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsWrapperSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EUnitTestFramework_002EMigrations_002EEnableDisabledProvidersMigration/@EntryIndexedValue">True</s:Boolean>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class AutoMapperConfiguration : AutoMapperTupleBase
/// </summary>
public override void CreateMap()
{
CreateMap<EntityRoleInputDto, EntityRole>()
.ForMember(mr => mr.FilterGroupJson, opt => opt.MapFrom(dto => dto.FilterGroup.ToJsonString(false, false)));
//CreateMap<EntityRoleInputDto, EntityRole>()
// .ForMember(mr => mr.FilterGroupJson, opt => opt.MapFrom(dto => dto.FilterGroup.ToJsonString(false, false)));

//mapper.CreateMap<EntityRole, EntityRoleOutputDto>()
// .ForMember(dto => dto.FilterGroup, opt => opt.ResolveUsing(mr => mr.FilterGroupJson?.FromJsonString<FilterGroup>()));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// <copyright file="EntityRoleOutputDto.cs" company="OSharp开源团队">
// Copyright (c) 2014-2018 OSharp. All rights reserved.
// </copyright>
Expand Down Expand Up @@ -43,7 +43,7 @@ public EntityRoleOutputDto(EntityRole entityRole)
IsLocked = entityRole.IsLocked;
Operation = entityRole.Operation;
CreatedTime = entityRole.CreatedTime;
FilterGroup = entityRole.FilterGroupJson.FromJsonString<FilterGroup>();
FilterGroup = entityRole.FilterGroup;
}

/// <summary>
Expand Down
8 changes: 4 additions & 4 deletions samples/web/Liuliu.Demo.Web/Liuliu.Demo.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="AspectCore.Extensions.Hosting" Version="2.4.0" />
<PackageReference Include="AspectCore.Extensions.Hosting" Version="2.*" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6'">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="[6.0.26, 7.0.0)" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="[6.0.26, 7.0.0)">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="[6.0.16, 7.0.0)" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.*" />
</ItemGroup>

<ItemGroup>
Expand Down
20 changes: 10 additions & 10 deletions samples/web/Liuliu.Demo.WebApi/Liuliu.Demo.WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,30 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.*" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.0.26" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.0.16" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.26">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="6.*" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="6.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\..\..\src\OSharp.EntityFrameworkCore.Oracle\OSharp.EntityFrameworkCore.Oracle.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.15" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.11" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.15">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.*" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\..\..\src\OSharp.EntityFrameworkCore.Oracle\OSharp.EntityFrameworkCore.Oracle.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.1">
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.*" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MiniRazor" Version="2.2.2" />
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.3.0" />
<PackageReference Include="MiniRazor" Version="2.*" />
<PackageReference Include="System.IO.FileSystem.Primitives" Version="4.*" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 7 additions & 7 deletions samples/wpf/OSharp.CodeGenerator/OSharp.CodeGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AsmResolver.DotNet" Version="5.4.0" />
<PackageReference Include="MahApps.Metro" Version="2.4.10" />
<PackageReference Include="MahApps.Metro.IconPacks" Version="4.11.0" />
<PackageReference Include="MahApps.Metro.SimpleChildWindow" Version="2.2.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.22">
<PackageReference Include="AsmResolver.DotNet" Version="5.*" />
<PackageReference Include="MahApps.Metro" Version="2.*" />
<PackageReference Include="MahApps.Metro.IconPacks" Version="4.*" />
<PackageReference Include="MahApps.Metro.SimpleChildWindow" Version="2.*" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.*">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Notifications.Wpf.Core" Version="1.4.1" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0" PrivateAssets="All" />
<PackageReference Include="Notifications.Wpf.Core" Version="1.*" />
<PackageReference Include="PropertyChanged.Fody" Version="4.*" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 1 addition & 2 deletions src/OSharp.AspNetCore/HttpRequestExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ public static class HttpContextExtensions
/// <summary>
/// 确定指定的 HTTP 请求是否为 AJAX 请求。
/// </summary>
///
/// <returns>
/// 如果指定的 HTTP 请求是 AJAX 请求,则为 true;否则为 false。
/// </returns>
Expand Down Expand Up @@ -75,7 +74,7 @@ public static string GetClientIp(this HttpContext context)
string ip = context.Request.Headers["X-Forwarded-For"].FirstOrDefault();
if (string.IsNullOrEmpty(ip))
{
ip = context.Connection.RemoteIpAddress.ToString();
ip = context.Connection.RemoteIpAddress?.ToString();
}
return ip;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public override void OnActionExecuting(ActionExecutingContext context)
UserAgent = context.HttpContext.Request.Headers["User-Agent"].FirstOrDefault(),
CreatedTime = DateTime.Now
};
if (context.HttpContext.User.Identity.IsAuthenticated && context.HttpContext.User.Identity is ClaimsIdentity identity)
if (context.HttpContext.User.Identity?.IsAuthenticated == true && context.HttpContext.User.Identity is ClaimsIdentity identity)
{
operation.UserId = identity.GetUserId();
operation.UserName = identity.GetUserName();
Expand Down
18 changes: 9 additions & 9 deletions src/OSharp.AspNetCore/OSharp.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net6.0'">
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="[6.0.26, 7.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="[6.0.26, 7.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="[6.0.26, 7.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="6.*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.*" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="6.*" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net7.0'">
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="[7.0.15, 8.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="[7.0.15, 8.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="[7.0.15, 8.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="7.*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="7.*" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="7.*" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net8.0'">
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="[8.0.1, 9.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="[8.0.1, 9.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="[8.0.1, 9.0.0)" />
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="8.*" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="8.*" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="8.*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OSharp\OSharp.csproj" />
Expand Down
6 changes: 5 additions & 1 deletion src/OSharp.Authorization.Datas/DataAuthCacheBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public virtual void BuildCaches()

foreach (var entityRole in entityRoles)
{
FilterGroup filterGroup = entityRole.FilterGroupJson.FromJsonString<FilterGroup>();
FilterGroup filterGroup = entityRole.FilterGroupJson?.FromJsonString<FilterGroup>();
if (filterGroup == null)
{
continue;
}
string key = GetKey(entityRole.RoleName, entityRole.EntityTypeFullName, entityRole.Operation);
string name = GetName(entityRole.RoleName, entityRole.EntityTypeFullName, entityRole.Operation);

Expand Down
Loading

0 comments on commit df750b7

Please sign in to comment.