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

Commit bfdad43

Browse files
committed
clean up methods
1 parent f31722e commit bfdad43

File tree

4 files changed

+6
-15
lines changed

4 files changed

+6
-15
lines changed

src/ServiceStack.OrmLite/OrmLiteReadExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,7 @@ public static List<T> GetByIds<T>(this IDbCommand dbCmd, IEnumerable idValues)
549549
: Select<T>(dbCmd, OrmLiteConfig.DialectProvider.GetQuotedColumnName(ModelDefinition<T>.PrimaryKeyName) + " IN (" + sql + ")");
550550
}
551551

552-
[Obsolete(UseDbConnectionExtensions)]
553-
public static T GetByIdParam<T>(this IDbCommand dbCmd, object id)
552+
internal static T GetByIdParam<T>(this IDbCommand dbCmd, object id)
554553
where T : new()
555554
{
556555
var modelDef = ModelDefinition<T>.Definition;

src/ServiceStack.OrmLite/OrmLiteWriteConnectionExtensions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ public static void UpdateParam<T>(this IDbConnection dbConn, T obj)
115115
{
116116
dbConn.Exec(dbCmd =>
117117
{
118-
//var updateStmt = dbCmd.ReparameterizeInsert(obj)
119-
120118
var updateStmt = dbConn.CreateUpdateStatement(obj);
121119

122120
dbCmd.CommandText = updateStmt.CommandText;

src/ServiceStack.OrmLite/OrmLiteWriteExtensions.cs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,7 @@ public static void UpdateAll<T>(this IDbCommand dbCmd, IEnumerable<T> objs)
290290
}
291291
}
292292

293-
[Obsolete(UseDbConnectionExtensions)]
294-
public static IDbCommand CreateUpdateStatement<T>(this IDbConnection connection, T obj)
293+
internal static IDbCommand CreateUpdateStatement<T>(this IDbConnection connection, T obj)
295294
where T : new()
296295
{
297296
return OrmLiteConfig.DialectProvider.CreateParameterizedUpdateStatement(obj, connection);
@@ -430,20 +429,12 @@ public static void InsertAll<T>(this IDbCommand dbCmd, IEnumerable<T> objs)
430429
}
431430
}
432431

433-
[Obsolete(UseDbConnectionExtensions)]
434-
public static IDbCommand CreateInsertStatement<T>(this IDbConnection connection, T obj)
432+
internal static IDbCommand CreateInsertStatement<T>(this IDbConnection connection, T obj)
435433
where T: new()
436434
{
437435
return OrmLiteConfig.DialectProvider.CreateParameterizedInsertStatement(obj, connection);
438436
}
439437

440-
[Obsolete(UseDbConnectionExtensions)]
441-
public static void ReparameterizeInsert<T>(this IDbCommand command, T obj)
442-
where T : new()
443-
{
444-
OrmLiteConfig.DialectProvider.ReParameterizeInsertStatement(obj, command);
445-
}
446-
447438
[Obsolete(UseDbConnectionExtensions)]
448439
public static void Save<T>(this IDbCommand dbCmd, params T[] objs)
449440
where T : new()

tests/ServiceStack.OrmLite.Tests/SqlServerProviderTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ SELECT @Times AS Id
143143

144144
result = db.SqlScalar<int>("EXEC DummyScalar @Times", new Dictionary<string, object> { { "Times", 10 } });
145145
Assert.That(result, Is.EqualTo(expected));
146+
147+
result = db.SqlScalar<int>("SELECT 10");
148+
Assert.That(result, Is.EqualTo(expected));
146149
}
147150

148151
}

0 commit comments

Comments
 (0)