Commit db05dc42 authored by simon.cropp's avatar simon.cropp

remove an unuse param, remove elses through direct returns

parent 8d0eb4de
...@@ -395,24 +395,17 @@ private static CacheInfo GetCacheInfo(object param, Identity identity) ...@@ -395,24 +395,17 @@ private static CacheInfo GetCacheInfo(object param, Identity identity)
private static Func<IDataReader, T> GetDeserializer<T>(Identity identity, IDataReader reader, int startBound = 0, int length = -1, bool returnNullIfFirstMissing = false) private static Func<IDataReader, T> GetDeserializer<T>(Identity identity, IDataReader reader, int startBound = 0, int length = -1, bool returnNullIfFirstMissing = false)
{ {
object oDeserializer;
// dynamic is passed in as Object ... by c# design // dynamic is passed in as Object ... by c# design
if (typeof(T) == typeof(object) || typeof(T) == typeof(ExpandoObject)) if (typeof(T) == typeof(object) || typeof(T) == typeof(ExpandoObject))
{ {
return GetDynamicDeserializer<T>(reader,startBound, length, returnNullIfFirstMissing); return GetDynamicDeserializer<T>(reader,startBound, length, returnNullIfFirstMissing);
} }
else if (typeof(T).IsClass && typeof(T) != typeof(string)) if (typeof(T).IsClass && typeof(T) != typeof(string))
{ {
return GetClassDeserializer<T>(reader, startBound, length, returnNullIfFirstMissing: returnNullIfFirstMissing); return GetClassDeserializer<T>(reader, startBound, length, returnNullIfFirstMissing: returnNullIfFirstMissing);
} }
else return GetStructDeserializer<T>();
{
return GetStructDeserializer<T>(reader);
}
var deserializer = (Func<IDataReader, T>)oDeserializer;
return deserializer;
} }
private static Func<IDataReader, T> GetDynamicDeserializer<T>(IDataRecord reader, int startBound = 0, int length = -1, bool returnNullIfFirstMissing = false) private static Func<IDataReader, T> GetDynamicDeserializer<T>(IDataRecord reader, int startBound = 0, int length = -1, bool returnNullIfFirstMissing = false)
...@@ -647,7 +640,7 @@ private static int ExecuteCommand(IDbConnection cnn, IDbTransaction tranaction, ...@@ -647,7 +640,7 @@ private static int ExecuteCommand(IDbConnection cnn, IDbTransaction tranaction,
} }
} }
private static Func<IDataReader, T> GetStructDeserializer<T>(IDataReader reader) private static Func<IDataReader, T> GetStructDeserializer<T>()
{ {
return r => return r =>
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment