private static Expression TypeConstantIbaEquals(ConstantExpression ce, TypeImplementedByAllExpression typeIba) { if (ce.IsNull()) { return(EqualsToNull(typeIba.TypeColumn)); } return(EqualNullable(QueryBinder.TypeConstant((Type)ce.Value !), typeIba.TypeColumn.Value)); }
protected internal virtual Expression VisitTypeImplementedByAll(TypeImplementedByAllExpression typeIba) { var column = (PrimaryKeyExpression)Visit(typeIba.TypeColumn); if (column != typeIba.TypeColumn) { return(new TypeImplementedByAllExpression(column)); } return(typeIba); }
public ImplementedByAllExpression(Type type, Expression id, TypeImplementedByAllExpression typeId) : base(DbExpressionType.ImplementedByAll, type) { if (id == null) { throw new ArgumentNullException("id"); } if (id.Type != typeof(string)) { throw new ArgumentException("string"); } this.Id = id; this.TypeId = typeId ?? throw new ArgumentNullException("typeId"); }
public PrimaryKeyStringExpression(Expression id, TypeImplementedByAllExpression typeId) : base(DbExpressionType.PrimaryKeyString, typeof(PrimaryKey?)) { if (id == null) { throw new ArgumentNullException("id"); } if (id.Type != typeof(string)) { throw new ArgumentException("id should be a string"); } this.Id = id; this.TypeId = typeId ?? throw new ArgumentNullException("typeId"); }
public ImplementedByAllExpression(Type type, Expression id, TypeImplementedByAllExpression typeId, IntervalExpression?externalPeriod) : base(DbExpressionType.ImplementedByAll, type) { if (id == null) { throw new ArgumentNullException(nameof(id)); } if (id.Type != typeof(string)) { throw new ArgumentException("string"); } this.Id = id; this.TypeId = typeId ?? throw new ArgumentNullException(nameof(typeId)); this.ExternalPeriod = externalPeriod; }
protected internal override Expression VisitTypeImplementedByAll(TypeImplementedByAllExpression typeIba) { throw InvalidSqlExpression(typeIba); }
protected virtual bool CompareTypeImplementedByAll(TypeImplementedByAllExpression a, TypeImplementedByAllExpression b) { return(Compare(a.TypeColumn, b.TypeColumn)); }
private MethodCallExpression SchemaGetType(TypeImplementedByAllExpression typeIba) { return(Expression.Call(Expression.Constant(Schema.Current), miGetType, Visit(typeIba.TypeColumn).UnNullify())); }
public ImplementedByAllExpression(Type type, Expression id, TypeImplementedByAllExpression typeId) : base(DbExpressionType.ImplementedByAll, type) { if (id == null) throw new ArgumentNullException("id"); if (id.Type != typeof(string)) throw new ArgumentException("string"); if (typeId == null) throw new ArgumentNullException("typeId"); this.Id = id; this.TypeId = typeId; }
private static Expression TypeIbaIbaEquals(TypeImplementedByAllExpression t1, TypeImplementedByAllExpression t2) { return(Expression.Equal(t1.TypeColumn, t2.TypeColumn)); }
private static Expression TypeIbaIbaEquals(TypeImplementedByAllExpression t1, TypeImplementedByAllExpression t2) { return Expression.Equal(t1.TypeColumn, t2.TypeColumn); }
private static Expression TypeFieIbaEquals(TypeEntityExpression typeFie, TypeImplementedByAllExpression typeIba) { return Expression.And(NotEqualToNull(typeFie.ExternalId), EqualNullable(typeIba.TypeColumn, QueryBinder.TypeConstant(typeFie.TypeValue))); }
private static Expression TypeConstantIbaEquals(ConstantExpression ce, TypeImplementedByAllExpression typeIba) { if (ce.IsNull()) return EqualsToNull(typeIba.TypeColumn); return EqualNullable(QueryBinder.TypeConstant((Type)ce.Value), typeIba.TypeColumn.Value); }
protected virtual Expression VisitTypeImplementedByAll(TypeImplementedByAllExpression typeIba) { var column = Visit(typeIba.TypeColumn); if (column != typeIba.TypeColumn) return new TypeImplementedByAllExpression(column); return typeIba; }
public PrimaryKeyStringExpression(Expression id, TypeImplementedByAllExpression typeId) : base(DbExpressionType.PrimaryKeyString, typeof(PrimaryKey?)) { if (id == null) throw new ArgumentNullException("id"); if(id.Type != typeof(string)) throw new ArgumentException("id should be a string"); if(typeId == null) throw new ArgumentNullException("typeId"); this.Id = id; this.TypeId = typeId; }
private static Expression TypeIbIbaEquals(TypeImplementedByExpression typeIb, TypeImplementedByAllExpression typeIba) { return typeIb.TypeImplementations .Select(imp => Expression.And(NotEqualToNull(imp.Value), EqualNullable(typeIba.TypeColumn, QueryBinder.TypeConstant(imp.Key)))) .AggregateOr(); }
private static Expression TypeFieIbaEquals(TypeEntityExpression typeFie, TypeImplementedByAllExpression typeIba) { return(Expression.And(NotEqualToNull(typeFie.ExternalId), EqualNullable(typeIba.TypeColumn, QueryBinder.TypeConstant(typeFie.TypeValue)))); }
public ImplementedByAllExpression(Type type, Expression id, TypeImplementedByAllExpression typeId) : base(DbExpressionType.ImplementedByAll, type) { this.Id = id; this.TypeId = typeId; }
private static Expression TypeIbIbaEquals(TypeImplementedByExpression typeIb, TypeImplementedByAllExpression typeIba) { return(typeIb.TypeImplementations .Select(imp => Expression.And(NotEqualToNull(imp.Value), EqualNullable(typeIba.TypeColumn, QueryBinder.TypeConstant(imp.Key)))) .AggregateOr()); }
protected override Expression VisitTypeImplementedByAll(TypeImplementedByAllExpression typeIba) { throw InvalidSqlExpression(typeIba); }