File tree Expand file tree Collapse file tree 4 files changed +14
-13
lines changed
src/BootstrapBlazor.Server Expand file tree Collapse file tree 4 files changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -19,23 +19,24 @@ public partial class CacheList
1919 [ Inject , NotNull ]
2020 private IStringLocalizer < CacheList > ? Localizer { get ; set ; }
2121
22- private List < object > _cacheList = [ ] ;
22+ private List < object ? > _cacheList = [ ] ;
2323
2424 /// <summary>
2525 /// <inheritdoc/>
2626 /// </summary>
27- protected override async Task OnParametersSetAsync ( )
27+ protected override void OnInitialized ( )
2828 {
29- await base . OnParametersSetAsync ( ) ;
30-
31- await Task . Yield ( ) ;
29+ base . OnInitialized ( ) ;
3230 UpdateCacheList ( ) ;
3331 }
3432
3533 private void OnDelete ( object key )
3634 {
37- CacheManager . Clear ( key ) ;
38- UpdateCacheList ( ) ;
35+ if ( key is ICacheEntry entry )
36+ {
37+ CacheManager . Clear ( entry . Key ) ;
38+ UpdateCacheList ( ) ;
39+ }
3940 }
4041
4142 private void OnDeleteAll ( )
@@ -51,15 +52,15 @@ private void OnRefresh()
5152
5253 private void UpdateCacheList ( )
5354 {
54- _cacheList = CacheManager . Keys . OrderBy ( i => i . ToString ( ) ) . Select ( key =>
55+ _cacheList = [ .. CacheManager . Keys . OrderBy ( i => i . ToString ( ) ) . Select ( key =>
5556 {
5657 ICacheEntry ? entry = null ;
5758 if ( CacheManager . TryGetCacheEntry ( key , out var val ) )
5859 {
5960 entry = val ;
6061 }
61- return ( object ) entry ! ;
62- } ) . ToList ( ) ;
62+ return entry ;
63+ } ) . Where ( i => i != null ) ] ;
6364 }
6465
6566 private static string GetKey ( object data ) => data is ICacheEntry entry ? entry . Key . ToString ( ) ! : "-" ;
Original file line number Diff line number Diff line change 33
44<h3 >@Localizer ["Title"]</h3 >
55
6- <DemoBlock Title =" @Localizer[" BasicTitle " ]" Introduction =" @Localizer[" BasicIntroe " ]" Name =" Normal" >
6+ <DemoBlock Title =" @Localizer[" BasicTitle " ]" Introduction =" @Localizer[" BasicIntro " ]" Name =" Normal" >
77 <section ignore class =" row g-3" >
88 <div class =" col-12" >
99 <BootstrapInputGroup >
Original file line number Diff line number Diff line change 64696469 "BootstrapBlazor.Server.Components.Samples.Stacks": {
64706470 "Title": "Stack Layout",
64716471 "BasicTitle": "Basic",
6472- "BasicIntroe ": "Lets you arrange its subcomponents in a horizontal or vertical stack",
6472+ "BasicIntro ": "Lets you arrange its subcomponents in a horizontal or vertical stack",
64736473 "RowMode": "Row",
64746474 "ColumnMode": "Column",
64756475 "Mode": "mode",
Original file line number Diff line number Diff line change 64696469 "BootstrapBlazor.Server.Components.Samples.Stacks" : {
64706470 "Title" : " Stack 布局" ,
64716471 "BasicTitle" : " 普通用法" ,
6472- "BasicIntroe " : " 可用于在水平或垂直堆栈中排列其子组件" ,
6472+ "BasicIntro " : " 可用于在水平或垂直堆栈中排列其子组件" ,
64736473 "RowMode" : " 行布局" ,
64746474 "ColumnMode" : " 列布局" ,
64756475 "Mode" : " 布局类型" ,
You can’t perform that action at this time.
0 commit comments