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

Commit 88538e1

Browse files
committed
Moar C# 6/5 fixes
1 parent 440ab69 commit 88538e1

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/ServiceStack.OrmLite/Dapper/CommandDefinition.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public CommandDefinition(string commandText, object parameters = null, IDbTransa
9696
#if ASYNC
9797
, CancellationToken cancellationToken = default(CancellationToken)
9898
#endif
99-
)
99+
) : this()
100100
{
101101
CommandText = commandText;
102102
Parameters = parameters;
@@ -126,7 +126,7 @@ internal IDbCommand SetupCommand(IDbConnection cnn, Action<IDbCommand, object> p
126126
{
127127
var cmd = cnn.CreateCommand();
128128
var init = GetInit(cmd.GetType());
129-
init?.Invoke(cmd);
129+
if (init != null) init(cmd);
130130
if (Transaction != null)
131131
cmd.Transaction = Transaction;
132132
cmd.CommandText = CommandText;
@@ -140,7 +140,7 @@ internal IDbCommand SetupCommand(IDbConnection cnn, Action<IDbCommand, object> p
140140
}
141141
if (CommandType.HasValue)
142142
cmd.CommandType = CommandType.Value;
143-
paramReader?.Invoke(cmd, Parameters);
143+
if (paramReader != null) paramReader(cmd, Parameters);
144144
return cmd;
145145
}
146146

src/ServiceStack.OrmLite/Dapper/DefaultTypeMap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public sealed class DefaultTypeMap : SqlMapper.ITypeMap
2121
public DefaultTypeMap(Type type)
2222
{
2323
if (type == null)
24-
throw new ArgumentNullException(nameof(type));
24+
throw new ArgumentNullException("type");
2525

2626
_fields = GetSettableFields(type);
2727
Properties = GetSettableProps(type);

src/ServiceStack.OrmLite/Dapper/SqlMapper.LiteralToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ internal struct LiteralToken
2020
/// </summary>
2121
public string Member { get; private set; }
2222

23-
internal LiteralToken(string token, string member)
23+
internal LiteralToken(string token, string member) : this()
2424
{
2525
Token = token;
2626
Member = member;

src/ServiceStack.OrmLite/Dapper/SqlMapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -904,7 +904,7 @@ private static GridReader QueryMultipleImpl(this IDbConnection cnn, ref CommandD
904904
catch { /* don't spoil the existing exception */ }
905905
reader.Dispose();
906906
}
907-
cmd?.Dispose();
907+
if (cmd != null) cmd.Dispose();
908908
if (wasClosed) cnn.Close();
909909
throw;
910910
}

0 commit comments

Comments
 (0)