csharp/0x1000000/SqExpress/SqExpress/SqModelSelectBuilder.cs

SqModelSelectBuilder.cs
using System;
using System.Collections.Generic;
using SqExpress.Syntax.Select;
using SqExpress.ModelSelect;
using SqExpress.Syntax.Names;

namespace SqExpress
{
    public static clast SqModelSelectBuilder
    {
        public static ModelSelect Select(ISqModelReader reader)
            where TTable : IExprTableSource, new()
        {
            return new ModelSelect(reader);
        }
    }

    public static clast ModelEmptyReader
    {
        public static ISqModelReader Get() => EmptyModelReaderStorage.Instance;

        public clast EmptyModelReaderStorage : ISqModelReader
        {
            public static readonly EmptyModelReaderStorage Instance = new EmptyModelReaderStorage();

            private EmptyModelReaderStorage() { }
#if !NETFRAMEWORK
            public IReadOnlyList GetColumns(TTable table) => Array.Empty();
#else
            public IReadOnlyList GetColumns(TTable table) => new ExprColumn[0];
#endif

            public int GetColumnCount() => 0;

            public object? Read(ISqDataRecordReader record, TTable table) => null;

            public object? ReadOrdinal(ISqDataRecordReader record, TTable table, int offset) => null;
        }
    }
}