////////////////////////////////////////////////////////////// // This code was generated by LLBLGen Pro 5.7. ////////////////////////////////////////////////////////////// // Code is generated on: // Code is generated using templates: SD.TemplateBindings.SharedTemplates // Templates vendor: Solutions Design. ////////////////////////////////////////////////////////////// using System; using System.ComponentModel; using System.Collections.Generic; using System.Runtime.Serialization; using System.Xml.Serialization; using Datalib.HelperClasses; using Datalib.FactoryClasses; using Datalib.RelationClasses; using SD.LLBLGen.Pro.ORMSupportClasses; namespace Datalib.EntityClasses { // __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces // __LLBLGENPRO_USER_CODE_REGION_END /// Entity class which represents the entity 'TblQuizTemplate'.

[Serializable] public partial class TblQuizTemplateEntity : CommonEntityBase // __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces // __LLBLGENPRO_USER_CODE_REGION_END { private EntityCollection _tblQuizzes; private EntityCollection _tblQuizTemplateDetails; private TblTrainingTypeEntity _tblTrainingType; // __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers // __LLBLGENPRO_USER_CODE_REGION_END private static TblQuizTemplateEntityStaticMetaData _staticMetaData = new TblQuizTemplateEntityStaticMetaData(); private static TblQuizTemplateRelations _relationsFactory = new TblQuizTemplateRelations(); /// All names of fields mapped onto a relation. Usable for in-memory filtering public static partial class MemberNames { /// Member name TblTrainingType public static readonly string TblTrainingType = "TblTrainingType"; /// Member name TblQuizzes public static readonly string TblQuizzes = "TblQuizzes"; /// Member name TblQuizTemplateDetails public static readonly string TblQuizTemplateDetails = "TblQuizTemplateDetails"; } /// Static meta-data storage for navigator related information protected class TblQuizTemplateEntityStaticMetaData : EntityStaticMetaDataBase { public TblQuizTemplateEntityStaticMetaData() { SetEntityCoreInfo("TblQuizTemplateEntity", InheritanceHierarchyType.None, false, (int)Datalib.EntityType.TblQuizTemplateEntity, typeof(TblQuizTemplateEntity), typeof(TblQuizTemplateEntityFactory), false); AddNavigatorMetaData>("TblQuizzes", a => a._tblQuizzes, (a, b) => a._tblQuizzes = b, a => a.TblQuizzes, () => new TblQuizTemplateRelations().TblQuizEntityUsingQuizTemplateId, typeof(TblQuizEntity), (int)Datalib.EntityType.TblQuizEntity); AddNavigatorMetaData>("TblQuizTemplateDetails", a => a._tblQuizTemplateDetails, (a, b) => a._tblQuizTemplateDetails = b, a => a.TblQuizTemplateDetails, () => new TblQuizTemplateRelations().TblQuizTemplateDetailEntityUsingQuizTemplateId, typeof(TblQuizTemplateDetailEntity), (int)Datalib.EntityType.TblQuizTemplateDetailEntity); AddNavigatorMetaData("TblTrainingType", "TblQuizTemplates", (a, b) => a._tblTrainingType = b, a => a._tblTrainingType, (a, b) => a.TblTrainingType = b, Datalib.RelationClasses.StaticTblQuizTemplateRelations.TblTrainingTypeEntityUsingTrainingTypeIdStatic, ()=>new TblQuizTemplateRelations().TblTrainingTypeEntityUsingTrainingTypeId, null, new int[] { (int)TblQuizTemplateFieldIndex.TrainingTypeId }, null, true, (int)Datalib.EntityType.TblTrainingTypeEntity); } } /// Static ctor static TblQuizTemplateEntity() { } /// CTor public TblQuizTemplateEntity() { InitClassEmpty(null, null); } /// CTor /// Fields object to set as the fields for this entity. public TblQuizTemplateEntity(IEntityFields2 fields) { InitClassEmpty(null, fields); } /// CTor /// The custom validator object for this TblQuizTemplateEntity public TblQuizTemplateEntity(IValidator validator) { InitClassEmpty(validator, null); } /// CTor /// PK value for TblQuizTemplate which data should be fetched into this TblQuizTemplate object public TblQuizTemplateEntity(System.String quizTemplateId) : this(quizTemplateId, null) { } /// CTor /// PK value for TblQuizTemplate which data should be fetched into this TblQuizTemplate object /// The custom validator object for this TblQuizTemplateEntity public TblQuizTemplateEntity(System.String quizTemplateId, IValidator validator) { InitClassEmpty(validator, null); this.QuizTemplateId = quizTemplateId; } /// Private CTor for deserialization /// /// protected TblQuizTemplateEntity(SerializationInfo info, StreamingContext context) : base(info, context) { // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END } /// Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblQuiz' to this entity. /// public virtual IRelationPredicateBucket GetRelationInfoTblQuizzes() { return CreateRelationInfoForNavigator("TblQuizzes"); } /// Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblQuizTemplateDetail' to this entity. /// public virtual IRelationPredicateBucket GetRelationInfoTblQuizTemplateDetails() { return CreateRelationInfoForNavigator("TblQuizTemplateDetails"); } /// Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblTrainingType' to this entity. /// public virtual IRelationPredicateBucket GetRelationInfoTblTrainingType() { return CreateRelationInfoForNavigator("TblTrainingType"); } /// protected override EntityStaticMetaDataBase GetEntityStaticMetaData() { return _staticMetaData; } /// Initializes the class members private void InitClassMembers() { PerformDependencyInjection(); // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers // __LLBLGENPRO_USER_CODE_REGION_END OnInitClassMembersComplete(); } /// Initializes the class with empty data, as if it is a new Entity. /// The validator object for this TblQuizTemplateEntity /// Fields of this entity private void InitClassEmpty(IValidator validator, IEntityFields2 fields) { OnInitializing(); this.Fields = fields ?? CreateFields(); this.Validator = validator; InitClassMembers(); // __LLBLGENPRO_USER_CODE_REGION_START InitClassEmpty // __LLBLGENPRO_USER_CODE_REGION_END OnInitialized(); } /// The relations object holding all relations of this entity with other entity classes. public static TblQuizTemplateRelations Relations { get { return _relationsFactory; } } /// Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblQuiz' for this entity. /// Ready to use IPrefetchPathElement2 implementation. public static IPrefetchPathElement2 PrefetchPathTblQuizzes { get { return _staticMetaData.GetPrefetchPathElement("TblQuizzes", CommonEntityBase.CreateEntityCollection()); } } /// Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblQuizTemplateDetail' for this entity. /// Ready to use IPrefetchPathElement2 implementation. public static IPrefetchPathElement2 PrefetchPathTblQuizTemplateDetails { get { return _staticMetaData.GetPrefetchPathElement("TblQuizTemplateDetails", CommonEntityBase.CreateEntityCollection()); } } /// Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblTrainingType' for this entity. /// Ready to use IPrefetchPathElement2 implementation. public static IPrefetchPathElement2 PrefetchPathTblTrainingType { get { return _staticMetaData.GetPrefetchPathElement("TblTrainingType", CommonEntityBase.CreateEntityCollection()); } } /// The FooterDes property of the Entity TblQuizTemplate

/// Mapped on table field: "tblQuizTemplate"."FooterDes".
Table field type characteristics (type, precision, scale, length): LongVarWChar, 0, 0, 536870911.
Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual System.String FooterDes { get { return (System.String)GetValue((int)TblQuizTemplateFieldIndex.FooterDes, true); } set { SetValue((int)TblQuizTemplateFieldIndex.FooterDes, value); } } /// The HeaderDes property of the Entity TblQuizTemplate

/// Mapped on table field: "tblQuizTemplate"."HeaderDes".
Table field type characteristics (type, precision, scale, length): LongVarWChar, 0, 0, 536870911.
Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual System.String HeaderDes { get { return (System.String)GetValue((int)TblQuizTemplateFieldIndex.HeaderDes, true); } set { SetValue((int)TblQuizTemplateFieldIndex.HeaderDes, value); } } /// The QuizTemplateCode property of the Entity TblQuizTemplate

/// Mapped on table field: "tblQuizTemplate"."QuizTemplateCode".
Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255.
Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual System.String QuizTemplateCode { get { return (System.String)GetValue((int)TblQuizTemplateFieldIndex.QuizTemplateCode, true); } set { SetValue((int)TblQuizTemplateFieldIndex.QuizTemplateCode, value); } } /// The QuizTemplateId property of the Entity TblQuizTemplate

/// Mapped on table field: "tblQuizTemplate"."QuizTemplateID".
Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32.
Table field behavior characteristics (is nullable, is PK, is identity): false, true, false
public virtual System.String QuizTemplateId { get { return (System.String)GetValue((int)TblQuizTemplateFieldIndex.QuizTemplateId, true); } set { SetValue((int)TblQuizTemplateFieldIndex.QuizTemplateId, value); } } /// The Renumering property of the Entity TblQuizTemplate

/// Mapped on table field: "tblQuizTemplate"."Renumering".
Table field type characteristics (type, precision, scale, length): Boolean, 0, 0, 2.
Table field behavior characteristics (is nullable, is PK, is identity): false, false, false
public virtual System.Boolean Renumering { get { return (System.Boolean)GetValue((int)TblQuizTemplateFieldIndex.Renumering, true); } set { SetValue((int)TblQuizTemplateFieldIndex.Renumering, value); } } /// The TemplateQuizName property of the Entity TblQuizTemplate

/// Mapped on table field: "tblQuizTemplate"."TemplateQuizName".
Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255.
Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual System.String TemplateQuizName { get { return (System.String)GetValue((int)TblQuizTemplateFieldIndex.TemplateQuizName, true); } set { SetValue((int)TblQuizTemplateFieldIndex.TemplateQuizName, value); } } /// The TrainingTypeId property of the Entity TblQuizTemplate

/// Mapped on table field: "tblQuizTemplate"."TrainingTypeID".
Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2.
Table field behavior characteristics (is nullable, is PK, is identity): false, false, false
public virtual System.String TrainingTypeId { get { return (System.String)GetValue((int)TblQuizTemplateFieldIndex.TrainingTypeId, true); } set { SetValue((int)TblQuizTemplateFieldIndex.TrainingTypeId, value); } } /// Gets the EntityCollection with the related entities of type 'TblQuizEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.

[TypeContainedAttribute(typeof(TblQuizEntity))] public virtual EntityCollection TblQuizzes { get { return GetOrCreateEntityCollection("TblQuizTemplate", true, false, ref _tblQuizzes); } } /// Gets the EntityCollection with the related entities of type 'TblQuizTemplateDetailEntity' which are related to this entity via a relation of type '1:n'. If the EntityCollection hasn't been fetched yet, the collection returned will be empty.

[TypeContainedAttribute(typeof(TblQuizTemplateDetailEntity))] public virtual EntityCollection TblQuizTemplateDetails { get { return GetOrCreateEntityCollection("TblQuizTemplate", true, false, ref _tblQuizTemplateDetails); } } /// Gets / sets related entity of type 'TblTrainingTypeEntity' which has to be set using a fetch action earlier. If no related entity is set for this property, null is returned..

[Browsable(false)] public virtual TblTrainingTypeEntity TblTrainingType { get { return _tblTrainingType; } set { SetSingleRelatedEntityNavigator(value, "TblTrainingType"); } } // __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode // __LLBLGENPRO_USER_CODE_REGION_END } } namespace Datalib { public enum TblQuizTemplateFieldIndex { ///FooterDes. FooterDes, ///HeaderDes. HeaderDes, ///QuizTemplateCode. QuizTemplateCode, ///QuizTemplateId. QuizTemplateId, ///Renumering. Renumering, ///TemplateQuizName. TemplateQuizName, ///TrainingTypeId. TrainingTypeId, /// AmountOfFields } } namespace Datalib.RelationClasses { /// Implements the relations factory for the entity: TblQuizTemplate. public partial class TblQuizTemplateRelations: RelationFactory { /// Returns a new IEntityRelation object, between TblQuizTemplateEntity and TblQuizEntity over the 1:n relation they have, using the relation between the fields: TblQuizTemplate.QuizTemplateId - TblQuiz.QuizTemplateId public virtual IEntityRelation TblQuizEntityUsingQuizTemplateId { get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.OneToMany, "TblQuizzes", true, new[] { TblQuizTemplateFields.QuizTemplateId, TblQuizFields.QuizTemplateId }); } } /// Returns a new IEntityRelation object, between TblQuizTemplateEntity and TblQuizTemplateDetailEntity over the 1:n relation they have, using the relation between the fields: TblQuizTemplate.QuizTemplateId - TblQuizTemplateDetail.QuizTemplateId public virtual IEntityRelation TblQuizTemplateDetailEntityUsingQuizTemplateId { get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.OneToMany, "TblQuizTemplateDetails", true, new[] { TblQuizTemplateFields.QuizTemplateId, TblQuizTemplateDetailFields.QuizTemplateId }); } } /// Returns a new IEntityRelation object, between TblQuizTemplateEntity and TblTrainingTypeEntity over the m:1 relation they have, using the relation between the fields: TblQuizTemplate.TrainingTypeId - TblTrainingType.TrainingTypeId public virtual IEntityRelation TblTrainingTypeEntityUsingTrainingTypeId { get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.ManyToOne, "TblTrainingType", false, new[] { TblTrainingTypeFields.TrainingTypeId, TblQuizTemplateFields.TrainingTypeId }); } } } /// Static class which is used for providing relationship instances which are re-used internally for syncing internal static class StaticTblQuizTemplateRelations { internal static readonly IEntityRelation TblQuizEntityUsingQuizTemplateIdStatic = new TblQuizTemplateRelations().TblQuizEntityUsingQuizTemplateId; internal static readonly IEntityRelation TblQuizTemplateDetailEntityUsingQuizTemplateIdStatic = new TblQuizTemplateRelations().TblQuizTemplateDetailEntityUsingQuizTemplateId; internal static readonly IEntityRelation TblTrainingTypeEntityUsingTrainingTypeIdStatic = new TblQuizTemplateRelations().TblTrainingTypeEntityUsingTrainingTypeId; /// CTor static StaticTblQuizTemplateRelations() { } } }