public static void AddColumns <T>(this Projection projection) { var ids = GetColumnIds <T>(); foreach (var id in ids) { if (id == 0) { throw new Exception("ColumnId cannot be 0"); } projection.AddColumn(id); } }
public override IGridDataSource <TEntity> BuildSource(ISession session) { var projection = new Projection <TEntity>(session); if (SelectMode == ProjectionSelectMode.OnlySpecifiedColumns) { Definition.SelectedAccessors.Each(a => projection.AddColumn(a)); Definition.Columns.Where(c => c.IsOuterJoin).SelectMany(c => c.SelectAccessors()).Each(a => { alterProjection = p => p.OuterJoin(a); }); } _projectionBuilders.Each(x => x(projection)); return(new ProjectionDataSource <TEntity>(projection, SelectMode)); }