internal static Expression Emit_EnsureTypeAndWrap( Expression input, Expression keyReader, Expression entitySetReader, Type requestedType, Type identityType, Type actualType, MergeOption mergeOption, bool isProxy) { Expression input1 = CodeGenEmitter.Emit_EnsureType(input, requestedType); if (!requestedType.IsClass()) input1 = CodeGenEmitter.Emit_EnsureType(input, typeof (object)); return CodeGenEmitter.CreateEntityWrapper(CodeGenEmitter.Emit_EnsureType(input1, actualType), keyReader, entitySetReader, actualType, identityType, mergeOption, isProxy); }
internal static Expression Emit_UnwrapAndEnsureType(Expression input, Type type) { return CodeGenEmitter.Emit_EnsureType((Expression) Expression.Property(input, CodeGenEmitter.IEntityWrapper_Entity), type); }
internal static Expression Emit_Shaper_GetState(int stateSlotNumber, Type type) { return CodeGenEmitter.Emit_EnsureType((Expression) Expression.ArrayIndex(CodeGenEmitter.Shaper_State, (Expression) Expression.Constant((object) stateSlotNumber)), type); }
internal static Expression Emit_Reader_GetValue(int ordinal, Type type) { return CodeGenEmitter.Emit_EnsureType((Expression) Expression.Call(CodeGenEmitter.Shaper_Reader, CodeGenEmitter.DbDataReader_GetValue, (Expression) Expression.Constant((object) ordinal)), type); }
internal static Expression Emit_NullConstant(Type type) { return !type.IsNullable() ? CodeGenEmitter.Emit_EnsureType((Expression) Expression.Constant((object) null, typeof (object)), type) : (Expression) Expression.Constant((object) null, type); }