Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 268b3f3

Browse files
committed
deprecate To<T> extension methods
1 parent 7f1aed5 commit 268b3f3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ServiceStack.Text/StringExtensions.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,21 +1251,25 @@ namespace ServiceStack.Text
12511251
{
12521252
public static class StringTextExtensions
12531253
{
1254+
[Obsolete("Use ConvertTo<T>")]
12541255
public static T To<T>(this string value)
12551256
{
12561257
return TypeSerializer.DeserializeFromString<T>(value);
12571258
}
12581259

1260+
[Obsolete("Use ConvertTo<T>")]
12591261
public static T To<T>(this string value, T defaultValue)
12601262
{
12611263
return String.IsNullOrEmpty(value) ? defaultValue : TypeSerializer.DeserializeFromString<T>(value);
12621264
}
12631265

1266+
[Obsolete("Use ConvertTo<T>")]
12641267
public static T ToOrDefaultValue<T>(this string value)
12651268
{
12661269
return String.IsNullOrEmpty(value) ? default(T) : TypeSerializer.DeserializeFromString<T>(value);
12671270
}
12681271

1272+
[Obsolete("Use ConvertTo<T>")]
12691273
public static object To(this string value, Type type)
12701274
{
12711275
return TypeSerializer.DeserializeFromString(value, type);

0 commit comments

Comments
 (0)