Files
csharpcode/omegapro/Datalib/DatabaseGeneric/EntityClasses/TblQuizEntity.cs
2025-08-02 05:20:17 +07:00

272 lines
14 KiB
C#

//////////////////////////////////////////////////////////////
// <auto-generated>This code was generated by LLBLGen Pro 5.7.</auto-generated>
//////////////////////////////////////////////////////////////
// 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
/// <summary>Entity class which represents the entity 'TblQuiz'.<br/><br/></summary>
[Serializable]
public partial class TblQuizEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
private EntityCollection<TblQuizQuestionEntity> _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();
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
public static partial class MemberNames
{
/// <summary>Member name TblQuizTemplate</summary>
public static readonly string TblQuizTemplate = "TblQuizTemplate";
/// <summary>Member name TblQuizQuestions</summary>
public static readonly string TblQuizQuestions = "TblQuizQuestions";
}
/// <summary>Static meta-data storage for navigator related information</summary>
protected class TblQuizEntityStaticMetaData : EntityStaticMetaDataBase
{
public TblQuizEntityStaticMetaData()
{
SetEntityCoreInfo("TblQuizEntity", InheritanceHierarchyType.None, false, (int)Datalib.EntityType.TblQuizEntity, typeof(TblQuizEntity), typeof(TblQuizEntityFactory), false);
AddNavigatorMetaData<TblQuizEntity, EntityCollection<TblQuizQuestionEntity>>("TblQuizQuestions", a => a._tblQuizQuestions, (a, b) => a._tblQuizQuestions = b, a => a.TblQuizQuestions, () => new TblQuizRelations().TblQuizQuestionEntityUsingQuizId, typeof(TblQuizQuestionEntity), (int)Datalib.EntityType.TblQuizQuestionEntity);
AddNavigatorMetaData<TblQuizEntity, TblQuizTemplateEntity>("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);
}
}
/// <summary>Static ctor</summary>
static TblQuizEntity()
{
}
/// <summary> CTor</summary>
public TblQuizEntity()
{
InitClassEmpty(null, null);
}
/// <summary> CTor</summary>
/// <param name="fields">Fields object to set as the fields for this entity.</param>
public TblQuizEntity(IEntityFields2 fields)
{
InitClassEmpty(null, fields);
}
/// <summary> CTor</summary>
/// <param name="validator">The custom validator object for this TblQuizEntity</param>
public TblQuizEntity(IValidator validator)
{
InitClassEmpty(validator, null);
}
/// <summary> CTor</summary>
/// <param name="quizId">PK value for TblQuiz which data should be fetched into this TblQuiz object</param>
public TblQuizEntity(System.String quizId) : this(quizId, null)
{
}
/// <summary> CTor</summary>
/// <param name="quizId">PK value for TblQuiz which data should be fetched into this TblQuiz object</param>
/// <param name="validator">The custom validator object for this TblQuizEntity</param>
public TblQuizEntity(System.String quizId, IValidator validator)
{
InitClassEmpty(validator, null);
this.QuizId = quizId;
}
/// <summary>Private CTor for deserialization</summary>
/// <param name="info"></param>
/// <param name="context"></param>
protected TblQuizEntity(SerializationInfo info, StreamingContext context) : base(info, context)
{
// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
// __LLBLGENPRO_USER_CODE_REGION_END
}
/// <summary>Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entities of type 'TblQuizQuestion' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblQuizQuestions() { return CreateRelationInfoForNavigator("TblQuizQuestions"); }
/// <summary>Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblQuizTemplate' to this entity.</summary>
/// <returns></returns>
public virtual IRelationPredicateBucket GetRelationInfoTblQuizTemplate() { return CreateRelationInfoForNavigator("TblQuizTemplate"); }
/// <inheritdoc/>
protected override EntityStaticMetaDataBase GetEntityStaticMetaData() { return _staticMetaData; }
/// <summary>Initializes the class members</summary>
private void InitClassMembers()
{
PerformDependencyInjection();
// __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
// __LLBLGENPRO_USER_CODE_REGION_END
OnInitClassMembersComplete();
}
/// <summary>Initializes the class with empty data, as if it is a new Entity.</summary>
/// <param name="validator">The validator object for this TblQuizEntity</param>
/// <param name="fields">Fields of this entity</param>
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();
}
/// <summary>The relations object holding all relations of this entity with other entity classes.</summary>
public static TblQuizRelations Relations { get { return _relationsFactory; } }
/// <summary>Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblQuizQuestion' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblQuizQuestions { get { return _staticMetaData.GetPrefetchPathElement("TblQuizQuestions", CommonEntityBase.CreateEntityCollection<TblQuizQuestionEntity>()); } }
/// <summary>Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblQuizTemplate' for this entity.</summary>
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
public static IPrefetchPathElement2 PrefetchPathTblQuizTemplate { get { return _staticMetaData.GetPrefetchPathElement("TblQuizTemplate", CommonEntityBase.CreateEntityCollection<TblQuizTemplateEntity>()); } }
/// <summary>The QuizCode property of the Entity TblQuiz<br/><br/></summary>
/// <remarks>Mapped on table field: "tblQuizs"."QuizCode".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String QuizCode
{
get { return (System.String)GetValue((int)TblQuizFieldIndex.QuizCode, true); }
set { SetValue((int)TblQuizFieldIndex.QuizCode, value); }
}
/// <summary>The QuizId property of the Entity TblQuiz<br/><br/></summary>
/// <remarks>Mapped on table field: "tblQuizs"."QuizID".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32.<br/>Table field behavior characteristics (is nullable, is PK, is identity): false, true, false</remarks>
public virtual System.String QuizId
{
get { return (System.String)GetValue((int)TblQuizFieldIndex.QuizId, true); }
set { SetValue((int)TblQuizFieldIndex.QuizId, value); }
}
/// <summary>The QuizName property of the Entity TblQuiz<br/><br/></summary>
/// <remarks>Mapped on table field: "tblQuizs"."QuizName".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 255.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String QuizName
{
get { return (System.String)GetValue((int)TblQuizFieldIndex.QuizName, true); }
set { SetValue((int)TblQuizFieldIndex.QuizName, value); }
}
/// <summary>The QuizTemplateId property of the Entity TblQuiz<br/><br/></summary>
/// <remarks>Mapped on table field: "tblQuizs"."QuizTemplateID".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual System.String QuizTemplateId
{
get { return (System.String)GetValue((int)TblQuizFieldIndex.QuizTemplateId, true); }
set { SetValue((int)TblQuizFieldIndex.QuizTemplateId, value); }
}
/// <summary>The QuizTime property of the Entity TblQuiz<br/><br/></summary>
/// <remarks>Mapped on table field: "tblQuizs"."QuizTime".<br/>Table field type characteristics (type, precision, scale, length): Integer, 10, 0, 0.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int32> QuizTime
{
get { return (Nullable<System.Int32>)GetValue((int)TblQuizFieldIndex.QuizTime, false); }
set { SetValue((int)TblQuizFieldIndex.QuizTime, value); }
}
/// <summary>The QuizYear property of the Entity TblQuiz<br/><br/></summary>
/// <remarks>Mapped on table field: "tblQuizs"."QuizYear".<br/>Table field type characteristics (type, precision, scale, length): Integer, 10, 0, 0.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
public virtual Nullable<System.Int32> QuizYear
{
get { return (Nullable<System.Int32>)GetValue((int)TblQuizFieldIndex.QuizYear, false); }
set { SetValue((int)TblQuizFieldIndex.QuizYear, value); }
}
/// <summary>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.<br/><br/></summary>
[TypeContainedAttribute(typeof(TblQuizQuestionEntity))]
public virtual EntityCollection<TblQuizQuestionEntity> TblQuizQuestions { get { return GetOrCreateEntityCollection<TblQuizQuestionEntity, TblQuizQuestionEntityFactory>("TblQuiz", true, false, ref _tblQuizQuestions); } }
/// <summary>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..<br/><br/></summary>
[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
{
///<summary>QuizCode. </summary>
QuizCode,
///<summary>QuizId. </summary>
QuizId,
///<summary>QuizName. </summary>
QuizName,
///<summary>QuizTemplateId. </summary>
QuizTemplateId,
///<summary>QuizTime. </summary>
QuizTime,
///<summary>QuizYear. </summary>
QuizYear,
/// <summary></summary>
AmountOfFields
}
}
namespace Datalib.RelationClasses
{
/// <summary>Implements the relations factory for the entity: TblQuiz. </summary>
public partial class TblQuizRelations: RelationFactory
{
/// <summary>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</summary>
public virtual IEntityRelation TblQuizQuestionEntityUsingQuizId
{
get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.OneToMany, "TblQuizQuestions", true, new[] { TblQuizFields.QuizId, TblQuizQuestionFields.QuizId }); }
}
/// <summary>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</summary>
public virtual IEntityRelation TblQuizTemplateEntityUsingQuizTemplateId
{
get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.ManyToOne, "TblQuizTemplate", false, new[] { TblQuizTemplateFields.QuizTemplateId, TblQuizFields.QuizTemplateId }); }
}
}
/// <summary>Static class which is used for providing relationship instances which are re-used internally for syncing</summary>
internal static class StaticTblQuizRelations
{
internal static readonly IEntityRelation TblQuizQuestionEntityUsingQuizIdStatic = new TblQuizRelations().TblQuizQuestionEntityUsingQuizId;
internal static readonly IEntityRelation TblQuizTemplateEntityUsingQuizTemplateIdStatic = new TblQuizRelations().TblQuizTemplateEntityUsingQuizTemplateId;
/// <summary>CTor</summary>
static StaticTblQuizRelations() { }
}
}