コード例 #1
0
        public void DeleteByExpressionNode_TestMethod()
        {
            int mzRegId = 12963;
            Expression <Func <OulInvoiceRegDto, bool> > query = (x => x.MzRegId == mzRegId);

            Serialize.Linq.Nodes.ExpressionNode expressionNode = query.ToExpressionNode();

            var getByIdRequest = BuildRequest("Delete", new object[] { expressionNode });

            var getByIdResponse = ServiceWrapper.ProcessRequest(getByIdRequest);

            Assert.True(getByIdResponse.Status == ResponseStatus.OK);
        }
コード例 #2
0
        public void GetByExpressionNode_TestMethod()
        {
            int mzRegId = 12963;
            Expression <Func <OulInvoiceRegDto, bool> > query = (x => x.MzRegId == mzRegId);

            Serialize.Linq.Nodes.ExpressionNode expressionNode = query.ToExpressionNode();

            var getByIdRequest = BuildRequest("Get", new object[] { expressionNode });

            var getByIdResponse = ServiceWrapper.ProcessRequest(getByIdRequest);

            Assert.True(getByIdResponse.Status == ResponseStatus.OK);

            if (getByIdResponse.Result != null)
            {
                IList <OulInvoiceRegDto> dtos = getByIdResponse.Result as IList <OulInvoiceRegDto>;
                Assert.NotNull(dtos);
            }
        }
コード例 #3
0
 /// <summary>
 /// Converts to a boolean expression.
 /// </summary>
 /// <typeparam name="TEntity">The type of the entity.</typeparam>
 /// <param name="expressionNode">The expression node.</param>
 /// <param name="context">The context.</param>
 /// <returns></returns>
 private static Expression <Func <TEntity, bool> > ConvertToBooleanExpression <TEntity>(ExpressionNode expressionNode, IExpressionContext context)
 {
     return(ConvertToExpression <Func <TEntity, bool> >(expressionNode, context));
 }
コード例 #4
0
        /// <summary>
        /// Converts to an expression.
        /// </summary>
        /// <typeparam name="TDelegate">The type of the delegate.</typeparam>
        /// <param name="expressionNode">The expression node.</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        private static Expression <TDelegate> ConvertToExpression <TDelegate>(ExpressionNode expressionNode, IExpressionContext context)
        {
            var expression = expressionNode.ToExpression(context);

            return((Expression <TDelegate>)expression);
        }
コード例 #5
0
 protected override void Initialize(UnaryExpression expression)
 {
     this.Operand = this.Factory.Create(expression.Operand);
 }
コード例 #6
0
 /// <summary>
 /// Initializes the specified expression.
 /// </summary>
 /// <param name="expression">The expression.</param>
 protected override void Initialize(ConditionalExpression expression)
 {
     this.Test    = this.Factory.Create(expression.Test);
     this.IfTrue  = this.Factory.Create(expression.IfTrue);
     this.IfFalse = this.Factory.Create(expression.IfFalse);
 }
コード例 #7
0
 protected override void Initialize(IndexExpression expression)
 {
     Arguments = new ExpressionNodeList(Factory, expression.Arguments);
     Indexer   = new PropertyInfoNode(Factory, expression.Indexer);
     Object    = Factory.Create(expression.Object);
 }
コード例 #8
0
 protected override void Initialize(ListInitExpression expression)
 {
     this.Initializers  = new ElementInitNodeList(this.Factory, expression.Initializers);
     this.NewExpression = this.Factory.Create(expression.NewExpression);
 }