abstract private GetExpression ( Alias tableAlias, QueryBinder binder, |
||
tableAlias | Alias | |
binder | QueryBinder | |
id | ||
return |
internal Expression FieldExpression(Alias tableAlias, QueryBinder binder, bool withRowId) { var rowId = RowIdExpression(tableAlias); var exp = Field.GetExpression(tableAlias, binder, rowId); if (!withRowId) { return(exp); } var type = this.Field.FieldType; var ci = typeof(MList <> .RowIdElement).MakeGenericType(type).GetConstructor(new[] { type, typeof(PrimaryKey), typeof(int?) }); var order = Order == null ? (Expression)Expression.Constant(null, typeof(int?)) : OrderExpression(tableAlias).Nullify(); return(Expression.New(ci, exp, rowId.UnNullify(), order)); }
internal Expression FieldExpression(Alias tableAlias, QueryBinder binder, IntervalExpression?externalPeriod, bool withRowId) { var rowId = RowIdExpression(tableAlias); var parentId = new PrimaryKeyExpression(new ColumnExpression(this.BackReference.Type.Nullify(), tableAlias, this.BackReference.Name)); var entityContext = new EntityContextInfo(parentId, rowId); var exp = Field.GetExpression(tableAlias, binder, rowId, externalPeriod, entityContext); if (!withRowId) { return(exp); } var type = this.Field.FieldType; var ci = typeof(MList <> .RowIdElement).MakeGenericType(type).GetConstructor(new[] { type, typeof(PrimaryKey), typeof(int?) }); var order = Order == null ? (Expression)Expression.Constant(null, typeof(int?)) : OrderExpression(tableAlias).Nullify(); return(Expression.New(ci, exp, rowId.UnNullify(), order)); }