////////////////////////////////////////////////////////////// // 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 'TblQuiz'.

[Serializable] public partial class TblQuizEntity : CommonEntityBase // __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces // __LLBLGENPRO_USER_CODE_REGION_END { private EntityCollection _tblQuizQuestions; private TblQuizTemplateEntity _tblQuizTemplate; // __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers // __LLBLGENPRO_USER_CODE_REGION_END private static TblQuizEntityStaticMetaData _staticMetaData = new TblQuizEntityStaticMetaData(); private static TblQuizRelations _relationsFactory = new TblQuizRelations(); /// All names of fields mapped onto a relation. Usable for in-memory filtering public static partial class MemberNames { /// Member name TblQuizTemplate public static readonly string TblQuizTemplate = "TblQuizTemplate"; /// Member name TblQuizQuestions public static readonly string TblQuizQuestions = "TblQuizQuestions"; } /// Static meta-data storage for navigator related information protected class TblQuizEntityStaticMetaData : EntityStaticMetaDataBase { public TblQuizEntityStaticMetaData() { SetEntityCoreInfo("TblQuizEntity", InheritanceHierarchyType.None, false, (int)Datalib.EntityType.TblQuizEntity, typeof(TblQuizEntity), typeof(TblQuizEntityFactory), false); AddNavigatorMetaData>("TblQuizQuestions", a => a._tblQuizQuestions, (a, b) => a._tblQuizQuestions = b, a => a.TblQuizQuestions, () => new TblQuizRelations().TblQuizQuestionEntityUsingQuizId, typeof(TblQuizQuestionEntity), (int)Datalib.EntityType.TblQuizQuestionEntity); AddNavigatorMetaData("TblQuizTemplate", "TblQuizzes", (a, b) => a._tblQuizTemplate = b, a => a._tblQuizTemplate, (a, b) => a.TblQuizTemplate = b, Datalib.RelationClasses.StaticTblQuizRelations.TblQuizTemplateEntityUsingQuizTemplateIdStatic, ()=>new TblQuizRelations().TblQuizTemplateEntityUsingQuizTemplateId, null, new int[] { (int)TblQuizFieldIndex.QuizTemplateId }, null, true, (int)Datalib.EntityType.TblQuizTemplateEntity); } } /// Static ctor static TblQuizEntity() { } /// CTor public TblQuizEntity() { InitClassEmpty(null, null); } /// CTor /// Fields object to set as the fields for this entity. public TblQuizEntity(IEntityFields2 fields) { InitClassEmpty(null, fields); } /// CTor /// The custom validator object for this TblQuizEntity public TblQuizEntity(IValidator validator) { InitClassEmpty(validator, null); } /// CTor /// PK value for TblQuiz which data should be fetched into this TblQuiz object public TblQuizEntity(System.String quizId) : this(quizId, null) { } /// CTor /// PK value for TblQuiz which data should be fetched into this TblQuiz object /// The custom validator object for this TblQuizEntity public TblQuizEntity(System.String quizId, IValidator validator) { InitClassEmpty(validator, null); this.QuizId = quizId; } /// Private CTor for deserialization /// /// protected TblQuizEntity(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 'TblQuizQuestion' to this entity. /// public virtual IRelationPredicateBucket GetRelationInfoTblQuizQuestions() { return CreateRelationInfoForNavigator("TblQuizQuestions"); } /// Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblQuizTemplate' to this entity. /// public virtual IRelationPredicateBucket GetRelationInfoTblQuizTemplate() { return CreateRelationInfoForNavigator("TblQuizTemplate"); } /// 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 TblQuizEntity /// 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 TblQuizRelations Relations { get { return _relationsFactory; } } /// Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblQuizQuestion' for this entity. /// Ready to use IPrefetchPathElement2 implementation. public static IPrefetchPathElement2 PrefetchPathTblQuizQuestions { get { return _staticMetaData.GetPrefetchPathElement("TblQuizQuestions", CommonEntityBase.CreateEntityCollection()); } } /// Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblQuizTemplate' for this entity. /// Ready to use IPrefetchPathElement2 implementation. public static IPrefetchPathElement2 PrefetchPathTblQuizTemplate { get { return _staticMetaData.GetPrefetchPathElement("TblQuizTemplate", CommonEntityBase.CreateEntityCollection()); } } /// The QuizCode property of the Entity TblQuiz

/// Mapped on table field: "tblQuizs"."QuizCode".
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 QuizCode { get { return (System.String)GetValue((int)TblQuizFieldIndex.QuizCode, true); } set { SetValue((int)TblQuizFieldIndex.QuizCode, value); } } /// The QuizId property of the Entity TblQuiz

/// Mapped on table field: "tblQuizs"."QuizID".
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 QuizId { get { return (System.String)GetValue((int)TblQuizFieldIndex.QuizId, true); } set { SetValue((int)TblQuizFieldIndex.QuizId, value); } } /// The QuizName property of the Entity TblQuiz

/// Mapped on table field: "tblQuizs"."QuizName".
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 QuizName { get { return (System.String)GetValue((int)TblQuizFieldIndex.QuizName, true); } set { SetValue((int)TblQuizFieldIndex.QuizName, value); } } /// The QuizTemplateId property of the Entity TblQuiz

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

/// Mapped on table field: "tblQuizs"."QuizTime".
Table field type characteristics (type, precision, scale, length): Integer, 10, 0, 0.
Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual Nullable QuizTime { get { return (Nullable)GetValue((int)TblQuizFieldIndex.QuizTime, false); } set { SetValue((int)TblQuizFieldIndex.QuizTime, value); } } /// The QuizYear property of the Entity TblQuiz

/// Mapped on table field: "tblQuizs"."QuizYear".
Table field type characteristics (type, precision, scale, length): Integer, 10, 0, 0.
Table field behavior characteristics (is nullable, is PK, is identity): true, false, false
public virtual Nullable QuizYear { get { return (Nullable)GetValue((int)TblQuizFieldIndex.QuizYear, false); } set { SetValue((int)TblQuizFieldIndex.QuizYear, value); } } /// Gets the EntityCollection with the related entities of type 'TblQuizQuestionEntity' 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(TblQuizQuestionEntity))] public virtual EntityCollection TblQuizQuestions { get { return GetOrCreateEntityCollection("TblQuiz", true, false, ref _tblQuizQuestions); } } /// Gets / sets related entity of type 'TblQuizTemplateEntity' 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 TblQuizTemplateEntity TblQuizTemplate { get { return _tblQuizTemplate; } set { SetSingleRelatedEntityNavigator(value, "TblQuizTemplate"); } } // __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode // __LLBLGENPRO_USER_CODE_REGION_END } } namespace Datalib { public enum TblQuizFieldIndex { ///QuizCode. QuizCode, ///QuizId. QuizId, ///QuizName. QuizName, ///QuizTemplateId. QuizTemplateId, ///QuizTime. QuizTime, ///QuizYear. QuizYear, /// AmountOfFields } } namespace Datalib.RelationClasses { /// Implements the relations factory for the entity: TblQuiz. public partial class TblQuizRelations: RelationFactory { /// Returns a new IEntityRelation object, between TblQuizEntity and TblQuizQuestionEntity over the 1:n relation they have, using the relation between the fields: TblQuiz.QuizId - TblQuizQuestion.QuizId public virtual IEntityRelation TblQuizQuestionEntityUsingQuizId { get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.OneToMany, "TblQuizQuestions", true, new[] { TblQuizFields.QuizId, TblQuizQuestionFields.QuizId }); } } /// Returns a new IEntityRelation object, between TblQuizEntity and TblQuizTemplateEntity over the m:1 relation they have, using the relation between the fields: TblQuiz.QuizTemplateId - TblQuizTemplate.QuizTemplateId public virtual IEntityRelation TblQuizTemplateEntityUsingQuizTemplateId { get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.ManyToOne, "TblQuizTemplate", false, new[] { TblQuizTemplateFields.QuizTemplateId, TblQuizFields.QuizTemplateId }); } } } /// Static class which is used for providing relationship instances which are re-used internally for syncing internal static class StaticTblQuizRelations { internal static readonly IEntityRelation TblQuizQuestionEntityUsingQuizIdStatic = new TblQuizRelations().TblQuizQuestionEntityUsingQuizId; internal static readonly IEntityRelation TblQuizTemplateEntityUsingQuizTemplateIdStatic = new TblQuizRelations().TblQuizTemplateEntityUsingQuizTemplateId; /// CTor static StaticTblQuizRelations() { } } }