Esempio n. 1
0
 protected virtual SqlStatement GetGroupByClause(ColumnExpression columnExpression, QueryContext queryContext)
 {
     var sqlProvider = queryContext.DataContext.Vendor.SqlProvider;
     if (columnExpression.Table.Alias != null)
     {
         return sqlProvider.GetColumn(sqlProvider.GetTableAlias(columnExpression.Table.Alias),
                                      columnExpression.Name);
     }
     return sqlProvider.GetColumn(columnExpression.Name);
 }
 /// <summary>
 /// Registers the ColumnExpression as returned by the SQL request.
 /// </summary>
 /// <param name="expression"></param>
 /// <param name="dataRecordParameter"></param>
 /// <param name="mappingContextParameter"></param>
 /// <param name="builderContext"></param>
 /// <returns></returns>
 protected virtual Expression GetOutputValueReader(ColumnExpression expression,
                                                   ParameterExpression dataRecordParameter, ParameterExpression mappingContextParameter,
                                                   BuilderContext builderContext)
 {
     int valueIndex = RegisterOutputParameter(expression, builderContext);
     Type storageType = expression.StorageInfo != null ? expression.StorageInfo.GetMemberType() : null;
     return GetOutputValueReader(storageType ?? expression.Type, valueIndex, dataRecordParameter, mappingContextParameter);
 }