mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 18:57:39 -07:00
removed code redundancies.
This commit is contained in:
parent
6d3a604677
commit
9a24268ee7
24 changed files with 104 additions and 185 deletions
|
@ -25,41 +25,40 @@ namespace Marr.Data.Parameters
|
|||
if (type == typeof(String))
|
||||
return DbType.String;
|
||||
|
||||
else if (type == typeof(Int32))
|
||||
if (type == typeof(Int32))
|
||||
return DbType.Int32;
|
||||
|
||||
else if (type == typeof(Decimal))
|
||||
if (type == typeof(Decimal))
|
||||
return DbType.Decimal;
|
||||
|
||||
else if (type == typeof(DateTime))
|
||||
if (type == typeof(DateTime))
|
||||
return DbType.DateTime;
|
||||
|
||||
else if (type == typeof(Boolean))
|
||||
if (type == typeof(Boolean))
|
||||
return DbType.Boolean;
|
||||
|
||||
else if (type == typeof(Int16))
|
||||
if (type == typeof(Int16))
|
||||
return DbType.Int16;
|
||||
|
||||
else if (type == typeof(Single))
|
||||
if (type == typeof(Single))
|
||||
return DbType.Single;
|
||||
|
||||
else if (type == typeof(Int64))
|
||||
if (type == typeof(Int64))
|
||||
return DbType.Int64;
|
||||
|
||||
else if (type == typeof(Double))
|
||||
if (type == typeof(Double))
|
||||
return DbType.Double;
|
||||
|
||||
else if (type == typeof(Byte))
|
||||
if (type == typeof(Byte))
|
||||
return DbType.Byte;
|
||||
|
||||
else if (type == typeof(Byte[]))
|
||||
if (type == typeof(Byte[]))
|
||||
return DbType.Binary;
|
||||
|
||||
else if (type == typeof(Guid))
|
||||
if (type == typeof(Guid))
|
||||
return DbType.Guid;
|
||||
|
||||
else
|
||||
return DbType.Object;
|
||||
return DbType.Object;
|
||||
}
|
||||
|
||||
public void SetDbType(IDbDataParameter param, Enum dbType)
|
||||
|
|
|
@ -26,38 +26,37 @@ namespace Marr.Data.Parameters
|
|||
if (type == typeof(String))
|
||||
return OleDbType.VarChar;
|
||||
|
||||
else if (type == typeof(Int32))
|
||||
if (type == typeof(Int32))
|
||||
return OleDbType.Integer;
|
||||
|
||||
else if (type == typeof(Decimal))
|
||||
if (type == typeof(Decimal))
|
||||
return OleDbType.Decimal;
|
||||
|
||||
else if (type == typeof(DateTime))
|
||||
if (type == typeof(DateTime))
|
||||
return OleDbType.DBTimeStamp;
|
||||
|
||||
else if (type == typeof(Boolean))
|
||||
if (type == typeof(Boolean))
|
||||
return OleDbType.Boolean;
|
||||
|
||||
else if (type == typeof(Int16))
|
||||
if (type == typeof(Int16))
|
||||
return OleDbType.SmallInt;
|
||||
|
||||
else if (type == typeof(Int64))
|
||||
if (type == typeof(Int64))
|
||||
return OleDbType.BigInt;
|
||||
|
||||
else if (type == typeof(Double))
|
||||
if (type == typeof(Double))
|
||||
return OleDbType.Double;
|
||||
|
||||
else if (type == typeof(Byte))
|
||||
if (type == typeof(Byte))
|
||||
return OleDbType.Binary;
|
||||
|
||||
else if (type == typeof(Byte[]))
|
||||
if (type == typeof(Byte[]))
|
||||
return OleDbType.VarBinary;
|
||||
|
||||
else if (type == typeof(Guid))
|
||||
if (type == typeof(Guid))
|
||||
return OleDbType.Guid;
|
||||
|
||||
else
|
||||
return OleDbType.Variant;
|
||||
return OleDbType.Variant;
|
||||
}
|
||||
|
||||
public void SetDbType(IDbDataParameter param, Enum dbType)
|
||||
|
|
|
@ -26,41 +26,40 @@ namespace Marr.Data.Parameters
|
|||
if (type == typeof(String))
|
||||
return SqlDbType.VarChar;
|
||||
|
||||
else if (type == typeof(Int32))
|
||||
if (type == typeof(Int32))
|
||||
return SqlDbType.Int;
|
||||
|
||||
else if (type == typeof(Decimal))
|
||||
if (type == typeof(Decimal))
|
||||
return SqlDbType.Decimal;
|
||||
|
||||
else if (type == typeof(DateTime))
|
||||
if (type == typeof(DateTime))
|
||||
return SqlDbType.DateTime;
|
||||
|
||||
else if (type == typeof(Boolean))
|
||||
if (type == typeof(Boolean))
|
||||
return SqlDbType.Bit;
|
||||
|
||||
else if (type == typeof(Int16))
|
||||
if (type == typeof(Int16))
|
||||
return SqlDbType.SmallInt;
|
||||
|
||||
else if (type == typeof(Int64))
|
||||
if (type == typeof(Int64))
|
||||
return SqlDbType.BigInt;
|
||||
|
||||
else if (type == typeof(Double))
|
||||
if (type == typeof(Double))
|
||||
return SqlDbType.Float;
|
||||
|
||||
else if (type == typeof(Char))
|
||||
if (type == typeof(Char))
|
||||
return SqlDbType.Char;
|
||||
|
||||
else if (type == typeof(Byte))
|
||||
if (type == typeof(Byte))
|
||||
return SqlDbType.Binary;
|
||||
|
||||
else if (type == typeof(Byte[]))
|
||||
if (type == typeof(Byte[]))
|
||||
return SqlDbType.VarBinary;
|
||||
|
||||
else if (type == typeof(Guid))
|
||||
if (type == typeof(Guid))
|
||||
return SqlDbType.UniqueIdentifier;
|
||||
|
||||
else
|
||||
return SqlDbType.Variant;
|
||||
return SqlDbType.Variant;
|
||||
}
|
||||
|
||||
public void SetDbType(IDbDataParameter param, Enum dbType)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue