public static OdooFilter ToOdooExpresion <T>(object left, OdooOperator odooOperator, object right) where T : IOdooModel, new()
        {
            OdooFilter result;

            if (left is string member && right is object value)
            {
                result = ToOdooExpresion <T>(member, odooOperator, value);
            }
Example #2
0
 public OdooQueryBuilder <T> Where <TForeignKeyLevel1, TForeignKeyLevel2>(Expression <Func <T, long?> > expression, Expression <Func <TForeignKeyLevel1, long> > expressionForeignKeyLevel1, Expression <Func <TForeignKeyLevel2, object> > expressionForeignKeyLevel2, OdooOperator odooOperator, object value) where TForeignKeyLevel1 : IOdooModel, new() where TForeignKeyLevel2 : IOdooModel, new()
 {
     _query.Where(expression, expressionForeignKeyLevel1, expressionForeignKeyLevel2, odooOperator, value);
     return(this);
 }
Example #3
0
 public OdooQueryBuilder <T> Where(Expression <Func <T, object> > expression, OdooOperator odooOperator, object value)
 {
     _query.Where(expression, odooOperator, value);
     return(this);
 }
        public OdooQuery <T> Where <TForeignKeyLevel1, TForeignKeyLevel2>(Expression <Func <T, long> > expression, Expression <Func <TForeignKeyLevel1, long?> > expressionForeignKeyLevel1, Expression <Func <TForeignKeyLevel2, object> > expressionForeignKeyLevel2, OdooOperator odooOperator, object value) where TForeignKeyLevel1 : IOdooModel, new() where TForeignKeyLevel2 : IOdooModel, new()
        {
            var fields = OdooExtensions.GetOdooPropertyName <T>(OdooExpresionMapper.GetPropertyName(expression)) + '.' +
                         OdooExtensions.GetOdooPropertyName <TForeignKeyLevel1>(OdooExpresionMapper.GetPropertyName(expressionForeignKeyLevel1)) + '.' +
                         OdooExtensions.GetOdooPropertyName <TForeignKeyLevel2>(OdooExpresionMapper.GetPropertyName(expressionForeignKeyLevel2));

            Filters.Add(new OdooFilter {
                fields, odooOperator.Description(), value
            });
            return(this);
        }
 public OdooQuery <T> Where(Expression <Func <T, object> > expression, OdooOperator odooOperator, object value)
 {
     Filters.Add(OdooFilterMapper.ToOdooExpresion <T>(OdooExpresionMapper.GetPropertyName(expression), odooOperator, value));
     return(this);
 }
 public static OdooFilter ToOdooExpresion <T>(string propertyname, OdooOperator odooOperator, object value) where T : IOdooModel, new()
 {
     return(new OdooFilter {
         OdooExtensions.GetOdooPropertyName <T>(propertyname), odooOperator.Description(), value
     });
 }