Skip to content

Commit 6264cf8

Browse files
committed
Changed serializer options key object
1 parent 3da1307 commit 6264cf8

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

src/Blazor-ApexCharts/ChartSerializer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace BlazorApexCharts
66
{
77
public class ChartSerializer
88
{
9-
private static Dictionary<string, JsonSerializerOptions> _serializerOptions = new Dictionary<string, JsonSerializerOptions>();
9+
private static Dictionary<object, JsonSerializerOptions> _serializerOptions = new Dictionary<object, JsonSerializerOptions>();
1010

1111
private JsonSerializerOptions GenerateOptions<TItem>() where TItem : class
1212
{
@@ -24,7 +24,7 @@ private JsonSerializerOptions GenerateOptions<TItem>() where TItem : class
2424

2525
public JsonSerializerOptions GetOptions<TItem>() where TItem : class
2626
{
27-
string key = typeof(TItem).ToString();
27+
var key = typeof(TItem);
2828
if (_serializerOptions.ContainsKey(key))
2929
{
3030
return _serializerOptions[key];

src/Blazor-ApexCharts/Models/DataPoints/DataPoint.cs

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,5 @@ public class DataPoint<TItem> : IDataPoint<TItem>
1717
public IEnumerable<TItem> Items { get; set; }
1818

1919
}
20-
21-
//public class DataPointComparer<TItem> : IEqualityComparer<IDataPoint<TItem>>
22-
//{
23-
// public bool Equals(IDataPoint<TItem> dataPoint1, IDataPoint<TItem> dataPoint2)
24-
// {
25-
// if (dataPoint1 == null && dataPoint2 == null) { return true; }
26-
// if (dataPoint1 == null || dataPoint2 == null) { return false; }
27-
28-
// IDataPoint<TItem> point1 = dataPoint1;
29-
// IDataPoint<TItem> point2 = dataPoint2;
30-
31-
// //if (point1.X.ToString() != point2.X.ToString() || point1.YObject != point2.YObject) return false;
32-
// if (point1.X.ToString() != point2.X.ToString()) return false;
33-
34-
35-
// return true;
36-
// }
37-
38-
39-
40-
// public int GetHashCode([DisallowNull] IDataPoint<TItem> obj)
41-
// {
42-
// return obj.X.GetHashCode();
43-
// }
44-
//}
20+
4521
}

0 commit comments

Comments
 (0)