示例#1
0
        public void OrElse <TValue>(EntityField <T> schemaField, ComparisonOperator @operator, TValue value)
        {
            var valueExpression = ORMQueryExpressions.Value(value);

            OrElse(QueryExpression.Compare(
                       QueryExpression.Column(schemaField.Column.Name, schemaField.Source.AliasIdentifierExpression),
                       @operator,
                       valueExpression
                       ));
            AddJoin(schemaField.Source);
        }
示例#2
0
        private ValueExpression GetValueExpression(EntityField <T> entityField, T entity)
        {
            var interesectedFields = _entityView.ClassToEntityIntersection
                                     .IntersectedFields.FirstOrDefault(q => q.RightField == entityField);

            if (interesectedFields == null)
            {
                ExceptionHelper.ThrowEntityFieldNotFound();
            }

            var reader = new ViewReader <T>(entity);
            var value  = reader.Read <object>(interesectedFields.LeftPath);

            return(ORMQueryExpressions.Value(value));
        }
 public void Limit(int limit)
 => _limitExpression = ORMQueryExpressions.Value(limit);
 public void Offset(int offset)
 => _offsetExpression = ORMQueryExpressions.Value(offset);
示例#5
0
 public void Set <TProperty>(Expression <Func <T, TProperty> > fieldSelector, TProperty value)
 {
     Set(fieldSelector, ORMQueryExpressions.Value(value));
 }