/////////////////////////////////////////////////////////////// // 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(string.Empty, fieldName); } /// Creates a new field object with the name specified and of resulttype 'object'. Used for referring to aliased fields in another projection. /// The alias of the table/query to target. /// Name of the field. /// Ready to use field object public EntityField2 Field(string targetAlias, string fieldName) { return Field(targetAlias, fieldName); } /// Creates a new field object with the name specified and of resulttype 'TValue'. Used for referring to aliased fields in another projection. /// The type of the value represented by the field. /// Name of the field. /// Ready to use field object public EntityField2 Field(string fieldName) { return Field(string.Empty, fieldName); } /// Creates a new field object with the name specified and of resulttype 'TValue'. Used for referring to aliased fields in another projection. /// The type of the value. /// The alias of the table/query to target. /// Name of the field. /// Ready to use field object public EntityField2 Field(string targetAlias, string fieldName) { return new EntityField2(fieldName, targetAlias, typeof(TValue)); } /// Gets the next alias counter value to produce artifical aliases with private int GetNextAliasCounterValue() { _aliasCounter++; return _aliasCounter; } /// Creates and returns a new EntityQuery for the TblAgeGroup entity public EntityQuery TblAgeGroup { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblAgency entity public EntityQuery TblAgency { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblChild entity public EntityQuery TblChild { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblClinicInfo entity public EntityQuery TblClinicInfo { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblCommune entity public EntityQuery TblCommune { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblDiary entity public EntityQuery TblDiary { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblDistrict entity public EntityQuery TblDistrict { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblExaminationInfo entity public EntityQuery TblExaminationInfo { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblPatient entity public EntityQuery TblPatient { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblPreClinicsInfo entity public EntityQuery TblPreClinicsInfo { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblPregnanceInfo entity public EntityQuery TblPregnanceInfo { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblProvince entity public EntityQuery TblProvince { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblReferralFromPlace entity public EntityQuery TblReferralFromPlace { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblReferralsTo entity public EntityQuery TblReferralsTo { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblReferraltoService entity public EntityQuery TblReferraltoService { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblRegimen entity public EntityQuery TblRegimen { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblRegimenStopReason entity public EntityQuery TblRegimenStopReason { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblService entity public EntityQuery TblService { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblTest entity public EntityQuery TblTest { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblTreatment entity public EntityQuery TblTreatment { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblTreatmentInfo entity public EntityQuery TblTreatmentInfo { get { return Create(); } } /// Creates and returns a new EntityQuery for the TblWaitingList entity public EntityQuery TblWaitingList { get { return Create(); } } } }