예제 #1
0
파일: SelectQuery.cs 프로젝트: jweber/Dypo
        public SelectQuery(IDbContext dbContext, Expression <Predicate <TModel> > where = null)
            : base(dbContext)
        {
            _dbContext = dbContext;

            _projectionColumns.AddRange(ModelUtility.GetColumnNames <TModel>());
            _tableName = SqlGenerationUtility.GetTableName <TModel>();

            if (where != null)
            {
                var visitor = new SqlExpressionVisitor <TModel>();
                _wherePredicates.Add(visitor.VisitExpression(where));
            }
        }