/////////////////////////////////////////////////////////////// // 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 System.Collections.Generic; using SD.LLBLGen.Pro.LinqSupportClasses; using SD.LLBLGen.Pro.ORMSupportClasses; using Datalib; using Datalib.EntityClasses; using Datalib.FactoryClasses; using Datalib.HelperClasses; using Datalib.RelationClasses; namespace Datalib.Linq { /// Meta-data class for the construction of Linq queries which are to be executed using LLBLGen Pro code. public partial class LinqMetaData: ILinqMetaData { #region Class Member Declarations private IDataAccessAdapter _adapterToUse; private FunctionMappingStore _customFunctionMappings; private Context _contextToUse; #endregion /// CTor. Using this ctor will leave the IDataAccessAdapter object to use empty. To be able to execute the query, an IDataAccessAdapter instance /// is required, and has to be set on the LLBLGenProProvider2 object in the query to execute. public LinqMetaData() : this(null, null) { } /// CTor which accepts an IDataAccessAdapter implementing object, which will be used to execute queries created with this metadata class. /// the IDataAccessAdapter to use in queries created with this meta data /// Be aware that the IDataAccessAdapter object set via this property is kept alive by the LLBLGenProQuery objects created with this meta data /// till they go out of scope. public LinqMetaData(IDataAccessAdapter adapterToUse) : this (adapterToUse, null) { } /// CTor which accepts an IDataAccessAdapter implementing object, which will be used to execute queries created with this metadata class. /// the IDataAccessAdapter to use in queries created with this meta data /// The custom function mappings to use. These take higher precedence than the ones in the DQE to use. /// Be aware that the IDataAccessAdapter object set via this property is kept alive by the LLBLGenProQuery objects created with this meta data /// till they go out of scope. public LinqMetaData(IDataAccessAdapter adapterToUse, FunctionMappingStore customFunctionMappings) { _adapterToUse = adapterToUse; _customFunctionMappings = customFunctionMappings; } /// returns the datasource to use in a Linq query for the entity type specified /// the type of the entity to get the datasource for /// the requested datasource public IDataSource GetQueryableForEntity(int typeOfEntity) { IDataSource toReturn = null; switch((Datalib.EntityType)typeOfEntity) { case Datalib.EntityType.TblAgeGroupEntity: toReturn = this.TblAgeGroup; break; case Datalib.EntityType.TblAgencyEntity: toReturn = this.TblAgency; break; case Datalib.EntityType.TblChildEntity: toReturn = this.TblChild; break; case Datalib.EntityType.TblClinicInfoEntity: toReturn = this.TblClinicInfo; break; case Datalib.EntityType.TblCommuneEntity: toReturn = this.TblCommune; break; case Datalib.EntityType.TblDiaryEntity: toReturn = this.TblDiary; break; case Datalib.EntityType.TblDistrictEntity: toReturn = this.TblDistrict; break; case Datalib.EntityType.TblExaminationInfoEntity: toReturn = this.TblExaminationInfo; break; case Datalib.EntityType.TblPatientEntity: toReturn = this.TblPatient; break; case Datalib.EntityType.TblPreClinicsInfoEntity: toReturn = this.TblPreClinicsInfo; break; case Datalib.EntityType.TblPregnanceInfoEntity: toReturn = this.TblPregnanceInfo; break; case Datalib.EntityType.TblProvinceEntity: toReturn = this.TblProvince; break; case Datalib.EntityType.TblReferralFromPlaceEntity: toReturn = this.TblReferralFromPlace; break; case Datalib.EntityType.TblReferralsToEntity: toReturn = this.TblReferralsTo; break; case Datalib.EntityType.TblReferraltoServiceEntity: toReturn = this.TblReferraltoService; break; case Datalib.EntityType.TblRegimenEntity: toReturn = this.TblRegimen; break; case Datalib.EntityType.TblRegimenStopReasonEntity: toReturn = this.TblRegimenStopReason; break; case Datalib.EntityType.TblServiceEntity: toReturn = this.TblService; break; case Datalib.EntityType.TblTestEntity: toReturn = this.TblTest; break; case Datalib.EntityType.TblTreatmentEntity: toReturn = this.TblTreatment; break; case Datalib.EntityType.TblTreatmentInfoEntity: toReturn = this.TblTreatmentInfo; break; case Datalib.EntityType.TblWaitingListEntity: toReturn = this.TblWaitingList; break; default: toReturn = null; break; } return toReturn; } /// returns the datasource to use in a Linq query for the entity type specified /// the type of the entity to get the datasource for /// the requested datasource public DataSource2 GetQueryableForEntity() where TEntity : class { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } /// returns the datasource to use in a Linq query when targeting TblAgeGroupEntity instances in the database. public DataSource2 TblAgeGroup { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblAgencyEntity instances in the database. public DataSource2 TblAgency { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblChildEntity instances in the database. public DataSource2 TblChild { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblClinicInfoEntity instances in the database. public DataSource2 TblClinicInfo { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblCommuneEntity instances in the database. public DataSource2 TblCommune { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblDiaryEntity instances in the database. public DataSource2 TblDiary { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblDistrictEntity instances in the database. public DataSource2 TblDistrict { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblExaminationInfoEntity instances in the database. public DataSource2 TblExaminationInfo { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblPatientEntity instances in the database. public DataSource2 TblPatient { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblPreClinicsInfoEntity instances in the database. public DataSource2 TblPreClinicsInfo { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblPregnanceInfoEntity instances in the database. public DataSource2 TblPregnanceInfo { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblProvinceEntity instances in the database. public DataSource2 TblProvince { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblReferralFromPlaceEntity instances in the database. public DataSource2 TblReferralFromPlace { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblReferralsToEntity instances in the database. public DataSource2 TblReferralsTo { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblReferraltoServiceEntity instances in the database. public DataSource2 TblReferraltoService { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblRegimenEntity instances in the database. public DataSource2 TblRegimen { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblRegimenStopReasonEntity instances in the database. public DataSource2 TblRegimenStopReason { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblServiceEntity instances in the database. public DataSource2 TblService { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblTestEntity instances in the database. public DataSource2 TblTest { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblTreatmentEntity instances in the database. public DataSource2 TblTreatment { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblTreatmentInfoEntity instances in the database. public DataSource2 TblTreatmentInfo { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } /// returns the datasource to use in a Linq query when targeting TblWaitingListEntity instances in the database. public DataSource2 TblWaitingList { get { return new DataSource2(_adapterToUse, new ElementCreator(), _customFunctionMappings, _contextToUse); } } #region Class Property Declarations /// Gets / sets the IDataAccessAdapter to use for the queries created with this meta data object. /// Be aware that the IDataAccessAdapter object set via this property is kept alive by the LLBLGenProQuery objects created with this meta data /// till they go out of scope. public IDataAccessAdapter AdapterToUse { get { return _adapterToUse;} set { _adapterToUse = value;} } /// Gets or sets the custom function mappings to use. These take higher precedence than the ones in the DQE to use public FunctionMappingStore CustomFunctionMappings { get { return _customFunctionMappings; } set { _customFunctionMappings = value; } } /// Gets or sets the Context instance to use for entity fetches. public Context ContextToUse { get { return _contextToUse;} set { _contextToUse = value;} } #endregion } }