Пример #1
0
        public override void VisitMainFromClause(MainFromClause fromClause, QueryModel queryModel)
        {
            var tableName = fromClause.ItemType.GetTypeInfo().GetCustomAttribute <TableAttribute>().Name;

            _queryParts.AddFromPart($"\"{tableName}\"");

            base.VisitMainFromClause(fromClause, queryModel);
        }
Пример #2
0
 /// Adds a FROM part of the SQL query.
 ///
 /// If a subquery parts aggregator is open, redirects the call to it instead.
 public void AddFromPart(string fromPart)
 {
     if (_visitingSubQueryExpression)
     {
         _subQueryExpressionPartsAggregator.AddFromPart(fromPart);
     }
     else if (FromParts.Count(x => x.Contains(fromPart)) == 0)
     {
         FromParts.Add(fromPart);
     }
 }