コード例 #1
0
        public override JsonQueryBuilderAdapter Select(IWrapper <SqlServerQueryCommand> childQuery, string name, bool isSingular)
        {
            if (isSingular)
            {
                childQuery.ForJsonPathWithoutArrayWrapper();
            }
            else
            {
                childQuery.ForJsonPath();
            }

            if (isSingular)
            {
                command.Select(db.Functions.JsonQuery(childQuery.Value)).As(name);
            }
            else
            {
                command.Select(db.Functions.JsonQuery(db.Functions.Coalesce(childQuery.Value, (DbString)"[]"))).As(name);
            }

            return(new SqlServerJsonQueryBuilderAdapter(db, childQuery));
        }