Skip to content

Commit 3ef2d9a

Browse files
committed
Update NuGet package
1 parent a5ecf7c commit 3ef2d9a

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A capable alternative to `System.Convert`
1010
## <a href="https://www.nuget.org/packages/ConvertEx">NuGet Package</a>
1111

1212
```powershell
13-
Install-Package ConvertEx -Version 1.0.2
13+
Install-Package ConvertEx -Version 1.0.3
1414
```
1515

1616
## Usage Examples

src/ConvertEx/ConvertEx.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@ public static bool TryChangeType<T>(object value, out T convertedValue)
5252
return result;
5353
}
5454

55+
/// <summary>
56+
/// Changes the type of <paramref name="value"/> to <paramref name="conversionType"/>.
57+
/// </summary>
58+
/// <exception cref="InvalidCastException">Thrown in case of conversion failure.</exception>
59+
#if USE_INLINE
60+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
61+
#endif
62+
public static object ChangeType(object value, Type conversionType, IFormatProvider formatProvider)
63+
{
64+
return DefaultConverter.Convert(value, conversionType, formatProvider);
65+
}
66+
5567
/// <summary>
5668
/// Changes the type of <paramref name="value"/> to <paramref name="conversionType"/>.
5769
/// </summary>

src/ConvertEx/ConvertEx.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
<NoWarn>1701;1702;1591</NoWarn>
88
<LangVersion>9</LangVersion>
9-
<Version>1.0.2</Version>
9+
<Version>1.0.3</Version>
1010
<Authors>Javid Shoaei</Authors>
1111
<Company>github.com/dotnettools</Company>
1212
<Description>A capable alternative to System.Convert</Description>

0 commit comments

Comments
 (0)