File tree Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Expand file tree Collapse file tree 4 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ namespace Services.Extensions;
22
33public static class ListExtensions
44{
5- public static bool IsNullOrEmpty < T > ( this IList < T > ? list )
5+ public static bool IsNullOrEmpty < T > ( this IReadOnlyList < T > ? list )
66 {
77 return list is null || list . Count == 0 ;
88 }
Original file line number Diff line number Diff line change @@ -5,9 +5,8 @@ namespace Services.Models;
55public record MarketChart
66{
77 [ JsonPropertyName ( "prices" ) ]
8- public decimal [ ] [ ] ? Prices { get ; init ; }
9- [ JsonPropertyName ( "market_caps" ) ]
10- public decimal [ ] [ ] ? MarketCaps { get ; init ; }
8+ public IReadOnlyList < IReadOnlyList < decimal > > ? Prices { get ; init ; }
9+ [ JsonPropertyName ( "market_caps" ) ] public IReadOnlyList < IReadOnlyList < decimal > > ? MarketCaps { get ; init ; }
1110 [ JsonPropertyName ( "total_volumes" ) ]
12- public decimal [ ] [ ] ? TotalVolumes { get ; init ; }
11+ public IReadOnlyList < IReadOnlyList < decimal > > ? TotalVolumes { get ; init ; }
1312}
Original file line number Diff line number Diff line change @@ -22,14 +22,14 @@ public static List<MarketChartPoint> MapMarketChartToMarketChartPoints(MarketCha
2222 throw new MarketChartException ( $ "{ nameof ( marketChart . TotalVolumes ) } is null") ;
2323 }
2424
25- if ( marketChart . Prices . Length != marketChart . MarketCaps . Length ||
26- marketChart . Prices . Length != marketChart . TotalVolumes . Length )
25+ if ( marketChart . Prices . Count != marketChart . MarketCaps . Count ||
26+ marketChart . Prices . Count != marketChart . TotalVolumes . Count )
2727 {
2828 throw new MarketChartException ( "Unequal number of data points in market chart" ) ;
2929 }
3030
3131 var marketChartPoints = new List < MarketChartPoint > ( ) ;
32- for ( var i = 0 ; i < marketChart . Prices . Length ; i ++ )
32+ for ( var i = 0 ; i < marketChart . Prices . Count ; i ++ )
3333 {
3434 var marketData = new MarketChartPoint
3535 {
Original file line number Diff line number Diff line change 1414 <EnforeCodeStyleInBuild >true</EnforeCodeStyleInBuild >
1515 <EnableNETAnalyzers >true</EnableNETAnalyzers >
1616 <EnableCodeAnalysis >true</EnableCodeAnalysis >
17- <NoWarn >S6678;CA2007;CA1848;CA1002;CA1819; CA1305;CA1062;CA2000;CA5394;CA1724;CA1031;S3267;CA1515;S1118;CA1707;CA2234;CA1051;CA1063;S3881</NoWarn >
17+ <NoWarn >S6678;CA2007;CA1848;CA1002;CA1305;CA1062;CA2000;CA5394;CA1724;CA1031;S3267;CA1515;S1118;CA1707;CA2234;CA1051;CA1063;S3881</NoWarn >
1818 </PropertyGroup >
1919 <ItemGroup Condition =" '$(MSBuildProjectExtension)' != '.dcproj'" >
2020 <PackageReference Include =" SonarAnalyzer.CSharp" >
You can’t perform that action at this time.
0 commit comments