Initialize CBDD solution and add a .NET-focused gitignore for generated artifacts.

This commit is contained in:
Joseph Doherty
2026-02-20 12:54:07 -05:00
commit b8ed5ec500
214 changed files with 101452 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
using System.Collections;
using System.Linq;
using System.Linq.Expressions;
namespace ZB.MOM.WW.CBDD.Core.Query;
internal class BTreeQueryable<T> : IOrderedQueryable<T>
{
/// <summary>
/// Initializes a new queryable wrapper for the specified provider and expression.
/// </summary>
/// <param name="provider">The query provider.</param>
/// <param name="expression">The expression tree.</param>
public BTreeQueryable(IQueryProvider provider, Expression expression)
{
Provider = provider;
Expression = expression;
}
/// <summary>
/// Initializes a new queryable wrapper for the specified provider.
/// </summary>
/// <param name="provider">The query provider.</param>
public BTreeQueryable(IQueryProvider provider)
{
Provider = provider;
Expression = Expression.Constant(this);
}
/// <summary>
/// Gets the element type returned by this query.
/// </summary>
public Type ElementType => typeof(T);
/// <summary>
/// Gets the expression tree associated with this query.
/// </summary>
public Expression Expression { get; }
/// <summary>
/// Gets the query provider for this query.
/// </summary>
public IQueryProvider Provider { get; }
/// <inheritdoc />
public IEnumerator<T> GetEnumerator()
{
return Provider.Execute<IEnumerable<T>>(Expression).GetEnumerator();
}
/// <inheritdoc />
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}