Shaolinq.Persistence.DefaultGuidSqlDataType.GetReadExpression C# (CSharp) Method

GetReadExpression() public method

public GetReadExpression ( Expression dataReader, int ordinal ) : Expression
dataReader System.Linq.Expressions.Expression
ordinal int
return System.Linq.Expressions.Expression
		public override Expression GetReadExpression(Expression dataReader, int ordinal)
		{
			if (this.UnderlyingType == null)
			{
				return Expression.Condition
				(
					Expression.Call(dataReader, IsDbNullMethod, Expression.Constant(ordinal)),
					Expression.Convert(Expression.Constant(this.SupportedType.GetDefaultValue(), this.SupportedType), this.SupportedType),
					Expression.New
					(
						GuidConstructor,
						Expression.Call(dataReader, DataRecordMethods.GetStringMethod, Expression.Constant(ordinal))
					)
				);
			}
			else
			{	
				return Expression.Condition
				(
					Expression.Call(dataReader, IsDbNullMethod, Expression.Constant(ordinal)),
					Expression.Convert(Expression.Constant(null, typeof(Guid?)), this.SupportedType),
					Expression.New
					(
						NullableGuidConstructor,
						Expression.New
						(
							GuidConstructor,
							Expression.Call(dataReader, DataRecordMethods.GetStringMethod, Expression.Constant(ordinal))
						)
					)
				);
			}
		}
	}