Esempio n. 1
0
 internal virtual SqlExpression VisitDiscriminatedType(SqlDiscriminatedType dt) {
     dt.Discriminator = this.VisitExpression(dt.Discriminator);
     return dt;
 }
		internal override SqlExpression VisitDiscriminatedType(SqlDiscriminatedType dt)
		{
			if(_isDebugMode)
			{
				_commandStringBuilder.Append("DTYPE(");
			}
			base.VisitDiscriminatedType(dt);
			if(_isDebugMode)
			{
				_commandStringBuilder.Append(")");
			}
			return dt;
		}
		private Type GenerateDiscriminatedType(SqlDiscriminatedType dt)
		{
			Diagnostics.Debug.Assert(dt.ClrType == typeof(Type));

			LocalBuilder locDiscriminator = gen.DeclareLocal(dt.Discriminator.ClrType);
			this.GenerateExpressionForType(dt.Discriminator, dt.Discriminator.ClrType);
			gen.Emit(OpCodes.Stloc, locDiscriminator);

			return this.GenerateDiscriminatedType(dt.TargetType, locDiscriminator, dt.Discriminator.SqlType);
		}
		internal override SqlExpression VisitDiscriminatedType(SqlDiscriminatedType dt)
		{
			return new SqlDiscriminatedType(dt.SqlType, this.VisitExpression(dt.Discriminator), dt.TargetType, dt.SourceExpression);
		}