提交 edb2d4fa 编写于 作者: A Adam Schroder

Cleanup lambdas

上级 ce374c85
......@@ -25,17 +25,14 @@ public class MappingHelper
if (pc != null && pc.SerializedColumn)
{
converter = delegate(object src)
{
return DatabaseFactory.ColumnSerializer.Deserialize((string) src, dstType);
};
converter = src => DatabaseFactory.ColumnSerializer.Deserialize((string) src, dstType);
return converter;
}
// Standard DateTime->Utc mapper
if (pc != null && pc.ForceToUtc && srcType == typeof(DateTime) && (dstType == typeof(DateTime) || dstType == typeof(DateTime?)))
{
converter = delegate(object src) { return new DateTime(((DateTime)src).Ticks, DateTimeKind.Utc); };
converter = src => new DateTime(((DateTime) src).Ticks, DateTimeKind.Utc);
return converter;
}
......@@ -71,14 +68,13 @@ static bool IsIntegralType(Type t)
//var tc = Type.GetTypeCode(t);
//return tc >= TypeCode.SByte && tc <= TypeCode.UInt64;
//Not available for now
return new[]
{
typeof (SByte), typeof (Byte),
typeof (Int16), typeof (UInt16),
typeof (Int32), typeof (UInt32),
typeof (Int64), typeof (UInt64)
}.Contains(t);
{
typeof(SByte), typeof(Byte),
typeof(Int16), typeof(UInt16),
typeof(Int32), typeof(UInt32),
typeof(Int64), typeof(UInt64)
}.Contains(t);
}
public static object GetDefault(Type type)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册