332 lines
17 KiB
C#
332 lines
17 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 'TblQuestion'.<br/><br/></summary>
|
|
[Serializable]
|
|
public partial class TblQuestionEntity : CommonEntityBase
|
|
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
|
|
// __LLBLGENPRO_USER_CODE_REGION_END
|
|
|
|
{
|
|
private EntityCollection<TblQuizQuestionEntity> _tblQuizQuestions;
|
|
private TblSubjectEntity _tblSubject;
|
|
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
|
|
// __LLBLGENPRO_USER_CODE_REGION_END
|
|
|
|
private static TblQuestionEntityStaticMetaData _staticMetaData = new TblQuestionEntityStaticMetaData();
|
|
private static TblQuestionRelations _relationsFactory = new TblQuestionRelations();
|
|
|
|
/// <summary>All names of fields mapped onto a relation. Usable for in-memory filtering</summary>
|
|
public static partial class MemberNames
|
|
{
|
|
/// <summary>Member name TblSubject</summary>
|
|
public static readonly string TblSubject = "TblSubject";
|
|
/// <summary>Member name TblQuizQuestions</summary>
|
|
public static readonly string TblQuizQuestions = "TblQuizQuestions";
|
|
}
|
|
|
|
/// <summary>Static meta-data storage for navigator related information</summary>
|
|
protected class TblQuestionEntityStaticMetaData : EntityStaticMetaDataBase
|
|
{
|
|
public TblQuestionEntityStaticMetaData()
|
|
{
|
|
SetEntityCoreInfo("TblQuestionEntity", InheritanceHierarchyType.None, false, (int)Datalib.EntityType.TblQuestionEntity, typeof(TblQuestionEntity), typeof(TblQuestionEntityFactory), false);
|
|
AddNavigatorMetaData<TblQuestionEntity, EntityCollection<TblQuizQuestionEntity>>("TblQuizQuestions", a => a._tblQuizQuestions, (a, b) => a._tblQuizQuestions = b, a => a.TblQuizQuestions, () => new TblQuestionRelations().TblQuizQuestionEntityUsingQuestionId, typeof(TblQuizQuestionEntity), (int)Datalib.EntityType.TblQuizQuestionEntity);
|
|
AddNavigatorMetaData<TblQuestionEntity, TblSubjectEntity>("TblSubject", "TblQuestions", (a, b) => a._tblSubject = b, a => a._tblSubject, (a, b) => a.TblSubject = b, Datalib.RelationClasses.StaticTblQuestionRelations.TblSubjectEntityUsingSubjectIdStatic, ()=>new TblQuestionRelations().TblSubjectEntityUsingSubjectId, null, new int[] { (int)TblQuestionFieldIndex.SubjectId }, null, true, (int)Datalib.EntityType.TblSubjectEntity);
|
|
}
|
|
}
|
|
|
|
/// <summary>Static ctor</summary>
|
|
static TblQuestionEntity()
|
|
{
|
|
}
|
|
|
|
/// <summary> CTor</summary>
|
|
public TblQuestionEntity()
|
|
{
|
|
InitClassEmpty(null, null);
|
|
}
|
|
|
|
/// <summary> CTor</summary>
|
|
/// <param name="fields">Fields object to set as the fields for this entity.</param>
|
|
public TblQuestionEntity(IEntityFields2 fields)
|
|
{
|
|
InitClassEmpty(null, fields);
|
|
}
|
|
|
|
/// <summary> CTor</summary>
|
|
/// <param name="validator">The custom validator object for this TblQuestionEntity</param>
|
|
public TblQuestionEntity(IValidator validator)
|
|
{
|
|
InitClassEmpty(validator, null);
|
|
}
|
|
|
|
/// <summary> CTor</summary>
|
|
/// <param name="questionId">PK value for TblQuestion which data should be fetched into this TblQuestion object</param>
|
|
public TblQuestionEntity(System.String questionId) : this(questionId, null)
|
|
{
|
|
}
|
|
|
|
/// <summary> CTor</summary>
|
|
/// <param name="questionId">PK value for TblQuestion which data should be fetched into this TblQuestion object</param>
|
|
/// <param name="validator">The custom validator object for this TblQuestionEntity</param>
|
|
public TblQuestionEntity(System.String questionId, IValidator validator)
|
|
{
|
|
InitClassEmpty(validator, null);
|
|
this.QuestionId = questionId;
|
|
}
|
|
|
|
/// <summary>Private CTor for deserialization</summary>
|
|
/// <param name="info"></param>
|
|
/// <param name="context"></param>
|
|
protected TblQuestionEntity(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 'TblSubject' to this entity.</summary>
|
|
/// <returns></returns>
|
|
public virtual IRelationPredicateBucket GetRelationInfoTblSubject() { return CreateRelationInfoForNavigator("TblSubject"); }
|
|
|
|
/// <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 TblQuestionEntity</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 TblQuestionRelations 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 'TblSubject' for this entity.</summary>
|
|
/// <returns>Ready to use IPrefetchPathElement2 implementation.</returns>
|
|
public static IPrefetchPathElement2 PrefetchPathTblSubject { get { return _staticMetaData.GetPrefetchPathElement("TblSubject", CommonEntityBase.CreateEntityCollection<TblSubjectEntity>()); } }
|
|
|
|
/// <summary>The Answer property of the Entity TblQuestion<br/><br/></summary>
|
|
/// <remarks>Mapped on table field: "tblQuestions"."Answer".<br/>Table field type characteristics (type, precision, scale, length): LongVarWChar, 0, 0, 536870911.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
|
|
public virtual System.String Answer
|
|
{
|
|
get { return (System.String)GetValue((int)TblQuestionFieldIndex.Answer, true); }
|
|
set { SetValue((int)TblQuestionFieldIndex.Answer, value); }
|
|
}
|
|
|
|
/// <summary>The Content property of the Entity TblQuestion<br/><br/></summary>
|
|
/// <remarks>Mapped on table field: "tblQuestions"."Content".<br/>Table field type characteristics (type, precision, scale, length): LongVarWChar, 0, 0, 536870911.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
|
|
public virtual System.String Content
|
|
{
|
|
get { return (System.String)GetValue((int)TblQuestionFieldIndex.Content, true); }
|
|
set { SetValue((int)TblQuestionFieldIndex.Content, value); }
|
|
}
|
|
|
|
/// <summary>The CreateDate property of the Entity TblQuestion<br/><br/></summary>
|
|
/// <remarks>Mapped on table field: "tblQuestions"."CreateDate".<br/>Table field type characteristics (type, precision, scale, length): Date, 0, 0, 0.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
|
|
public virtual Nullable<System.DateTime> CreateDate
|
|
{
|
|
get { return (Nullable<System.DateTime>)GetValue((int)TblQuestionFieldIndex.CreateDate, false); }
|
|
set { SetValue((int)TblQuestionFieldIndex.CreateDate, value); }
|
|
}
|
|
|
|
/// <summary>The Difficulty property of the Entity TblQuestion<br/><br/></summary>
|
|
/// <remarks>Mapped on table field: "tblQuestions"."Difficulty".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 1.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
|
|
public virtual System.String Difficulty
|
|
{
|
|
get { return (System.String)GetValue((int)TblQuestionFieldIndex.Difficulty, true); }
|
|
set { SetValue((int)TblQuestionFieldIndex.Difficulty, value); }
|
|
}
|
|
|
|
/// <summary>The Exclusive property of the Entity TblQuestion<br/><br/></summary>
|
|
/// <remarks>Mapped on table field: "tblQuestions"."Exclusive".<br/>Table field type characteristics (type, precision, scale, length): Boolean, 0, 0, 2.<br/>Table field behavior characteristics (is nullable, is PK, is identity): false, false, false</remarks>
|
|
public virtual System.Boolean Exclusive
|
|
{
|
|
get { return (System.Boolean)GetValue((int)TblQuestionFieldIndex.Exclusive, true); }
|
|
set { SetValue((int)TblQuestionFieldIndex.Exclusive, value); }
|
|
}
|
|
|
|
/// <summary>The Explaination property of the Entity TblQuestion<br/><br/></summary>
|
|
/// <remarks>Mapped on table field: "tblQuestions"."Explaination".<br/>Table field type characteristics (type, precision, scale, length): LongVarWChar, 0, 0, 536870911.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
|
|
public virtual System.String Explaination
|
|
{
|
|
get { return (System.String)GetValue((int)TblQuestionFieldIndex.Explaination, true); }
|
|
set { SetValue((int)TblQuestionFieldIndex.Explaination, value); }
|
|
}
|
|
|
|
/// <summary>The FieldId property of the Entity TblQuestion<br/><br/></summary>
|
|
/// <remarks>Mapped on table field: "tblQuestions"."FieldID".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 1.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
|
|
public virtual System.String FieldId
|
|
{
|
|
get { return (System.String)GetValue((int)TblQuestionFieldIndex.FieldId, true); }
|
|
set { SetValue((int)TblQuestionFieldIndex.FieldId, value); }
|
|
}
|
|
|
|
/// <summary>The Level property of the Entity TblQuestion<br/><br/></summary>
|
|
/// <remarks>Mapped on table field: "tblQuestions"."Level".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 1.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
|
|
public virtual System.String Level
|
|
{
|
|
get { return (System.String)GetValue((int)TblQuestionFieldIndex.Level, true); }
|
|
set { SetValue((int)TblQuestionFieldIndex.Level, value); }
|
|
}
|
|
|
|
/// <summary>The QuestionCode property of the Entity TblQuestion<br/><br/></summary>
|
|
/// <remarks>Mapped on table field: "tblQuestions"."QuestionCode".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 10.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
|
|
public virtual System.String QuestionCode
|
|
{
|
|
get { return (System.String)GetValue((int)TblQuestionFieldIndex.QuestionCode, true); }
|
|
set { SetValue((int)TblQuestionFieldIndex.QuestionCode, value); }
|
|
}
|
|
|
|
/// <summary>The QuestionId property of the Entity TblQuestion<br/><br/></summary>
|
|
/// <remarks>Mapped on table field: "tblQuestions"."QuestionID".<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 QuestionId
|
|
{
|
|
get { return (System.String)GetValue((int)TblQuestionFieldIndex.QuestionId, true); }
|
|
set { SetValue((int)TblQuestionFieldIndex.QuestionId, value); }
|
|
}
|
|
|
|
/// <summary>The SubjectId property of the Entity TblQuestion<br/><br/></summary>
|
|
/// <remarks>Mapped on table field: "tblQuestions"."SubjectID".<br/>Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 2.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
|
|
public virtual System.String SubjectId
|
|
{
|
|
get { return (System.String)GetValue((int)TblQuestionFieldIndex.SubjectId, true); }
|
|
set { SetValue((int)TblQuestionFieldIndex.SubjectId, value); }
|
|
}
|
|
|
|
/// <summary>The Summary property of the Entity TblQuestion<br/><br/></summary>
|
|
/// <remarks>Mapped on table field: "tblQuestions"."Summary".<br/>Table field type characteristics (type, precision, scale, length): LongVarWChar, 0, 0, 536870911.<br/>Table field behavior characteristics (is nullable, is PK, is identity): true, false, false</remarks>
|
|
public virtual System.String Summary
|
|
{
|
|
get { return (System.String)GetValue((int)TblQuestionFieldIndex.Summary, true); }
|
|
set { SetValue((int)TblQuestionFieldIndex.Summary, 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>("TblQuestion", true, false, ref _tblQuizQuestions); } }
|
|
|
|
/// <summary>Gets / sets related entity of type 'TblSubjectEntity' 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 TblSubjectEntity TblSubject
|
|
{
|
|
get { return _tblSubject; }
|
|
set { SetSingleRelatedEntityNavigator(value, "TblSubject"); }
|
|
}
|
|
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
|
|
// __LLBLGENPRO_USER_CODE_REGION_END
|
|
|
|
|
|
}
|
|
}
|
|
|
|
namespace Datalib
|
|
{
|
|
public enum TblQuestionFieldIndex
|
|
{
|
|
///<summary>Answer. </summary>
|
|
Answer,
|
|
///<summary>Content. </summary>
|
|
Content,
|
|
///<summary>CreateDate. </summary>
|
|
CreateDate,
|
|
///<summary>Difficulty. </summary>
|
|
Difficulty,
|
|
///<summary>Exclusive. </summary>
|
|
Exclusive,
|
|
///<summary>Explaination. </summary>
|
|
Explaination,
|
|
///<summary>FieldId. </summary>
|
|
FieldId,
|
|
///<summary>Level. </summary>
|
|
Level,
|
|
///<summary>QuestionCode. </summary>
|
|
QuestionCode,
|
|
///<summary>QuestionId. </summary>
|
|
QuestionId,
|
|
///<summary>SubjectId. </summary>
|
|
SubjectId,
|
|
///<summary>Summary. </summary>
|
|
Summary,
|
|
/// <summary></summary>
|
|
AmountOfFields
|
|
}
|
|
}
|
|
|
|
namespace Datalib.RelationClasses
|
|
{
|
|
/// <summary>Implements the relations factory for the entity: TblQuestion. </summary>
|
|
public partial class TblQuestionRelations: RelationFactory
|
|
{
|
|
/// <summary>Returns a new IEntityRelation object, between TblQuestionEntity and TblQuizQuestionEntity over the 1:n relation they have, using the relation between the fields: TblQuestion.QuestionId - TblQuizQuestion.QuestionId</summary>
|
|
public virtual IEntityRelation TblQuizQuestionEntityUsingQuestionId
|
|
{
|
|
get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.OneToMany, "TblQuizQuestions", true, new[] { TblQuestionFields.QuestionId, TblQuizQuestionFields.QuestionId }); }
|
|
}
|
|
|
|
/// <summary>Returns a new IEntityRelation object, between TblQuestionEntity and TblSubjectEntity over the m:1 relation they have, using the relation between the fields: TblQuestion.SubjectId - TblSubject.SubjectId</summary>
|
|
public virtual IEntityRelation TblSubjectEntityUsingSubjectId
|
|
{
|
|
get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.ManyToOne, "TblSubject", false, new[] { TblSubjectFields.SubjectId, TblQuestionFields.SubjectId }); }
|
|
}
|
|
|
|
}
|
|
|
|
/// <summary>Static class which is used for providing relationship instances which are re-used internally for syncing</summary>
|
|
internal static class StaticTblQuestionRelations
|
|
{
|
|
internal static readonly IEntityRelation TblQuizQuestionEntityUsingQuestionIdStatic = new TblQuestionRelations().TblQuizQuestionEntityUsingQuestionId;
|
|
internal static readonly IEntityRelation TblSubjectEntityUsingSubjectIdStatic = new TblQuestionRelations().TblSubjectEntityUsingSubjectId;
|
|
|
|
/// <summary>CTor</summary>
|
|
static StaticTblQuestionRelations() { }
|
|
}
|
|
}
|