Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Activout.RestClient/ParamConverter/IParamConverter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#nullable disable
using System;
using System.Reflection;

Expand All @@ -7,6 +6,6 @@ namespace Activout.RestClient.ParamConverter
public interface IParamConverter
{
bool CanConvert(Type type, ParameterInfo parameterInfo);
string ToString(object value);
string ToString(object? value);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#nullable disable
using System;
using System.Reflection;

Expand All @@ -20,7 +19,7 @@ public bool CanConvert(Type type, ParameterInfo parameterInfo)
return type == typeof(DateTime);
}

public string ToString(object value)
public string ToString(object? value)
{
return value == null ? "" : ((DateTime)value).ToUnixTime().ToString();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#nullable disable
using System;
using System.Reflection;

Expand All @@ -11,7 +10,7 @@ public bool CanConvert(Type type, ParameterInfo parameterInfo)
return type == typeof(DateTime);
}

public string ToString(object value)
public string ToString(object? value)
{
return value == null ? "" : ((DateTime)value).ToString("o");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
#nullable disable
using System;
using System.Reflection;

namespace Activout.RestClient.ParamConverter.Implementation
namespace Activout.RestClient.ParamConverter.Implementation;

public class ToStringParamConverter : IParamConverter
{
public class ToStringParamConverter : IParamConverter
public bool CanConvert(Type type, ParameterInfo parameterInfo)
{
public bool CanConvert(Type type, ParameterInfo parameterInfo)
{
return true;
}
return true;
}

public string ToString(object value)
{
return value == null ? "" : value.ToString();
}
public string ToString(object? value)
{
return value?.ToString() ?? "";
}
}