Skip to content

Commit

Permalink
User Convert.To methods
Browse files Browse the repository at this point in the history
  • Loading branch information
VahidN committed Mar 2, 2024
1 parent cfac3d6 commit 5979c60
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>Entity Framework Core Second Level Caching Library.</Description>
<VersionPrefix>4.2.2</VersionPrefix>
<VersionPrefix>4.2.3</VersionPrefix>
<Authors>Vahid Nasiri</Authors>
<TargetFrameworks>net8.0;net7.0;net6.0;net5.0;netstandard2.1;netstandard2.0;net462;netcoreapp3.1;</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
18 changes: 9 additions & 9 deletions src/EFCoreSecondLevelCacheInterceptor/EFTableRowsDataReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ public override bool GetBoolean(int ordinal)
return (ulong)Convert.ChangeType(value, TypeExtensions.UlongTYpe, CultureInfo.InvariantCulture) != 0;
}

return (bool)value;
return Convert.ToBoolean(value, CultureInfo.InvariantCulture);
}

private Type GetOrdinalValueType(int ordinal, object value)
Expand Down Expand Up @@ -204,7 +204,7 @@ public override byte GetByte(int ordinal)
return (byte)Convert.ChangeType(value, TypeExtensions.ByteType, CultureInfo.InvariantCulture);
}

return (byte)value;
return Convert.ToByte(value, CultureInfo.InvariantCulture);
}

/// <summary>
Expand Down Expand Up @@ -245,7 +245,7 @@ public override char GetChar(int ordinal)
return checked((char)GetInt64(ordinal));
}

return (char)value;
return Convert.ToChar(value, CultureInfo.InvariantCulture);
}

/// <summary>
Expand Down Expand Up @@ -307,7 +307,7 @@ public override decimal GetDecimal(int ordinal)
return (decimal)Convert.ChangeType(value, TypeExtensions.DecimalType, CultureInfo.InvariantCulture);
}

return (decimal)value;
return Convert.ToDecimal(value, CultureInfo.InvariantCulture);
}

/// <summary>
Expand All @@ -329,7 +329,7 @@ public override double GetDouble(int ordinal)
return (double)Convert.ChangeType(value, TypeExtensions.DoubleType, CultureInfo.InvariantCulture);
}

return (double)value;
return Convert.ToDouble(value, CultureInfo.InvariantCulture);
}

/// <summary>
Expand Down Expand Up @@ -362,7 +362,7 @@ public override float GetFloat(int ordinal)
return (float)Convert.ChangeType(value, TypeExtensions.FloatType, CultureInfo.InvariantCulture);
}

return (float)value;
return Convert.ToSingle(value, CultureInfo.InvariantCulture);
}

/// <summary>
Expand Down Expand Up @@ -423,7 +423,7 @@ public override short GetInt16(int ordinal)
return (short)Convert.ChangeType(value, TypeExtensions.ShortType, CultureInfo.InvariantCulture);
}

return (short)value;
return Convert.ToInt16(value, CultureInfo.InvariantCulture);
}

/// <summary>
Expand Down Expand Up @@ -455,7 +455,7 @@ public override int GetInt32(int ordinal)
return (int)Convert.ChangeType(value, TypeExtensions.IntType, CultureInfo.InvariantCulture);
}

return (int)value;
return Convert.ToInt32(value, CultureInfo.InvariantCulture);
}

/// <summary>
Expand All @@ -482,7 +482,7 @@ public override long GetInt64(int ordinal)
return (long)Convert.ChangeType(value, TypeExtensions.LongType, CultureInfo.InvariantCulture);
}

return (long)value;
return Convert.ToInt64(value, CultureInfo.InvariantCulture);
}

/// <summary>
Expand Down

0 comments on commit 5979c60

Please sign in to comment.