///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated on:
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
//////////////////////////////////////////////////////////////
using System;
using System.Linq;
using Datalib.EntityClasses;
using Datalib.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;
using SD.LLBLGen.Pro.QuerySpec;
namespace Datalib.FactoryClasses
{
/// Factory class to produce DynamicQuery instances and EntityQuery instances
public partial class QueryFactory
{
private int _aliasCounter = 0;
/// Creates a new DynamicQuery instance with no alias set.
/// Ready to use DynamicQuery instance
public DynamicQuery Create()
{
return Create(string.Empty);
}
/// Creates a new DynamicQuery instance with the alias specified as the alias set.
/// The alias.
/// Ready to use DynamicQuery instance
public DynamicQuery Create(string alias)
{
return new DynamicQuery(new ElementCreator(), alias, this.GetNextAliasCounterValue());
}
/// Creates a new DynamicQuery which wraps the specified TableValuedFunction call
/// The table valued function call to wrap.
/// toWrap wrapped in a DynamicQuery.
public DynamicQuery Create(TableValuedFunctionCall toWrap)
{
return this.Create().From(new TvfCallWrapper(toWrap)).Select(toWrap.GetFieldsAsArray().Select(f => this.Field(toWrap.Alias, f.Alias)).ToArray());
}
/// Creates a new EntityQuery for the entity of the type specified with no alias set.
/// The type of the entity to produce the query for.
/// ready to use EntityQuery instance
public EntityQuery Create()
where TEntity : IEntityCore
{
return Create(string.Empty);
}
/// Creates a new EntityQuery for the entity of the type specified with the alias specified as the alias set.
/// The type of the entity to produce the query for.
/// The alias.
/// ready to use EntityQuery instance
public EntityQuery Create(string alias)
where TEntity : IEntityCore
{
return new EntityQuery(new ElementCreator(), alias, this.GetNextAliasCounterValue());
}
/// Creates a new field object with the name specified and of resulttype 'object'. Used for referring to aliased fields in another projection.
/// Name of the field.
/// Ready to use field object
public EntityField2 Field(string fieldName)
{
return Field