コード例 #1
0
		private DbCommand PrepareCommand(FormattedExpression fe)
		{
			switch (_Connection.State)
			{
				case System.Data.ConnectionState.Closed:
					_Connection.Open();
					goto case System.Data.ConnectionState.Open;

				case System.Data.ConnectionState.Open:
					var comm = _Connection.CreateCommand();

					comm.CommandText = fe.CommandText;
					foreach (var p in fe.Parameters)
						AddParameter(p, comm);

					return comm;

				default:
					throw new NotImplementedException("Not sure what to do here yet...");
			}
		}
コード例 #2
0
		private object ExecuteResult(FormattedExpression fe)
		{
			using (var command = PrepareCommand(fe))
			using (var reader = command.ExecuteReader())
			{
				return QueryMaterializer.Materialize(reader, fe.Expression.Projection, _Context);
			}
		}
コード例 #3
0
		private object ExecuteScalar(FormattedExpression te)
		{
			return null;
		}