Skip to content

Commit 841cf11

Browse files
Ja bist du narrischJa bist du narrisch
authored andcommitted
String to string
1 parent 4a9c76a commit 841cf11

22 files changed

+143
-143
lines changed

src/Migrator/Compile/ScriptEngine.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public ScriptEngine(string[] extraReferencedAssemblies)
2424

2525
public ScriptEngine(string codeType, string[] extraReferencedAssemblies)
2626
{
27-
if (!String.IsNullOrEmpty(codeType))
27+
if (!string.IsNullOrEmpty(codeType))
2828
{
2929
_codeType = codeType;
3030
}
@@ -58,7 +58,7 @@ private string[] GetFilesRecursive(string directory)
5858
private FileInfo[] GetFilesRecursive(DirectoryInfo d)
5959
{
6060
var files = new List<FileInfo>();
61-
files.AddRange(d.GetFiles(String.Format("*.{0}", _provider.FileExtension)));
61+
files.AddRange(d.GetFiles(string.Format("*.{0}", _provider.FileExtension)));
6262
var subDirs = d.GetDirectories();
6363
if (subDirs.Length > 0)
6464
{

src/Migrator/DuplicatedVersionException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace Migrator;
2525
public class DuplicatedVersionException : Exception
2626
{
2727
public DuplicatedVersionException(long version)
28-
: base(String.Format("Migration version #{0} is duplicated", version))
28+
: base(string.Format("Migration version #{0} is duplicated", version))
2929
{
3030
}
3131
}

src/Migrator/Framework/DataRecordExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ public static T TryParse<T>(this IDataRecord record, string name, Func<T> defaul
4141
return (T)((object)value.ToString());
4242
}
4343

44-
if (type == typeof(Int32?) || type == typeof(Int32))
44+
if (type == typeof(int?) || type == typeof(int))
4545
{
4646
return (T)(object)Convert.ToInt32(value);
4747
}
4848

49-
if (type == typeof(Int64?) || type == typeof(Int64))
49+
if (type == typeof(long?) || type == typeof(long))
5050
{
5151
return (T)(object)Convert.ToInt64(value);
5252
}
5353

5454
if (type == typeof(bool) || type == typeof(bool?))
5555
{
56-
if (value is Int32 || value is Int64 || value is Int16 || value is UInt16 || value is UInt32 || value is UInt64)
56+
if (value is int || value is long || value is short || value is ushort || value is uint || value is ulong)
5757
{
5858
var intValue = Convert.ToInt64(value);
5959
return (T)(object)(intValue != 0);

src/Migrator/Framework/ITransformationProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public interface ITransformationProvider : IDisposable
3232
/// <summary>
3333
/// Connection string to the database
3434
/// </summary>
35-
String ConnectionString { get; }
35+
string ConnectionString { get; }
3636

3737
/// <summary>
3838
/// Logger used to log details of operations performed during migration

src/Migrator/Framework/MigrationAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public MigrationAttribute(long version)
3535
}
3636
public MigrationAttribute(int year, int month, int day, int hour, int minute, int second)
3737
{
38-
var combined = String.Format("{0:D4}{1:D2}{2:D2}{3:D2}{4:D2}{5:D2}", year, month, day, hour, minute, second);
38+
var combined = string.Format("{0:D4}{1:D2}{2:D2}{3:D2}{4:D2}{5:D2}", year, month, day, hour, minute, second);
3939
Version = long.Parse(combined);
4040
}
4141
/// <summary>

src/Migrator/Framework/MigrationException.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public MigrationException(string message, Exception cause)
3131
}
3232

3333
public MigrationException(string migration, int version, Exception innerException)
34-
: base(String.Format("Exception in migration {0} (#{1})", migration, version), innerException)
34+
: base(string.Format("Exception in migration {0} (#{1})", migration, version), innerException)
3535
{
3636
}
3737
}

src/Migrator/Providers/ColumnPropertiesMapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public string IndexSql
7070
{
7171
if (dialect.SupportsIndex && indexed)
7272
{
73-
return String.Format("INDEX({0})", dialect.Quote(name));
73+
return string.Format("INDEX({0})", dialect.Quote(name));
7474
}
7575

7676
return null;
@@ -111,7 +111,7 @@ public virtual void MapColumnProperties(Column column)
111111

112112
AddDefaultValue(column, vals);
113113

114-
columnSql = String.Join(" ", vals.ToArray());
114+
columnSql = string.Join(" ", vals.ToArray());
115115
}
116116

117117
public virtual void MapColumnPropertiesWithoutDefault(Column column)

src/Migrator/Providers/Dialect.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public virtual ColumnPropertiesMapper GetColumnMapper(Column column)
223223

224224
if (!IdentityNeedsType && column.IsIdentity)
225225
{
226-
type = String.Empty;
226+
type = string.Empty;
227227
}
228228

229229
return new ColumnPropertiesMapper(this, type);
@@ -328,35 +328,35 @@ public virtual string SqlForProperty(ColumnProperty property, Column column)
328328
{
329329
return propertyMap[property];
330330
}
331-
return String.Empty;
331+
return string.Empty;
332332
}
333333

334334
public virtual string Quote(string value)
335335
{
336-
return String.Format(QuoteTemplate, value);
336+
return string.Format(QuoteTemplate, value);
337337
}
338338

339339
public virtual string Default(object defaultValue)
340340
{
341-
if (defaultValue is String && defaultValue.ToString() == String.Empty)
341+
if (defaultValue is string && defaultValue.ToString() == string.Empty)
342342
{
343343
defaultValue = "''";
344344
}
345345
else if (defaultValue is Guid)
346346
{
347-
return String.Format("DEFAULT '{0}'", defaultValue.ToString());
347+
return string.Format("DEFAULT '{0}'", defaultValue.ToString());
348348
}
349349
else if (defaultValue is DateTime)
350350
{
351-
return String.Format("DEFAULT '{0}'", ((DateTime)defaultValue).ToString("yyyy-MM-dd HH:mm:ss"));
351+
return string.Format("DEFAULT '{0}'", ((DateTime)defaultValue).ToString("yyyy-MM-dd HH:mm:ss"));
352352
}
353-
else if (defaultValue is String)
353+
else if (defaultValue is string)
354354
{
355-
defaultValue = ((String)defaultValue).Replace("'", "''");
355+
defaultValue = ((string)defaultValue).Replace("'", "''");
356356
defaultValue = "'" + defaultValue + "'";
357357
}
358358

359-
return String.Format("DEFAULT {0}", defaultValue);
359+
return string.Format("DEFAULT {0}", defaultValue);
360360
}
361361

362362
public ColumnPropertiesMapper GetAndMapColumnProperties(Column column)

src/Migrator/Providers/Impl/Firebird/FirebirdColumnPropertiesMapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ public override void MapColumnProperties(Column column)
3939

4040
AddNull(column, vals);
4141

42-
columnSql = String.Join(" ", vals.ToArray());
42+
columnSql = string.Join(" ", vals.ToArray());
4343
}
4444
}

src/Migrator/Providers/Impl/Firebird/FirebirdDialect.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public override ColumnPropertiesMapper GetColumnMapper(Column column)
5959

6060
if (!IdentityNeedsType && column.IsIdentity)
6161
{
62-
type = String.Empty;
62+
type = string.Empty;
6363
}
6464

6565
return new FirebirdColumnPropertiesMapper(this, type);

0 commit comments

Comments
 (0)