//////////////////////////////////////////////////////////////
// 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 'TblQuizQuestion'.
[Serializable]
public partial class TblQuizQuestionEntity : CommonEntityBase
// __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces
// __LLBLGENPRO_USER_CODE_REGION_END
{
private TblQuestionEntity _tblQuestion;
private TblQuizEntity _tblQuiz;
// __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers
// __LLBLGENPRO_USER_CODE_REGION_END
private static TblQuizQuestionEntityStaticMetaData _staticMetaData = new TblQuizQuestionEntityStaticMetaData();
private static TblQuizQuestionRelations _relationsFactory = new TblQuizQuestionRelations();
/// All names of fields mapped onto a relation. Usable for in-memory filtering
public static partial class MemberNames
{
/// Member name TblQuestion
public static readonly string TblQuestion = "TblQuestion";
/// Member name TblQuiz
public static readonly string TblQuiz = "TblQuiz";
}
/// Static meta-data storage for navigator related information
protected class TblQuizQuestionEntityStaticMetaData : EntityStaticMetaDataBase
{
public TblQuizQuestionEntityStaticMetaData()
{
SetEntityCoreInfo("TblQuizQuestionEntity", InheritanceHierarchyType.None, false, (int)Datalib.EntityType.TblQuizQuestionEntity, typeof(TblQuizQuestionEntity), typeof(TblQuizQuestionEntityFactory), false);
AddNavigatorMetaData("TblQuestion", "TblQuizQuestions", (a, b) => a._tblQuestion = b, a => a._tblQuestion, (a, b) => a.TblQuestion = b, Datalib.RelationClasses.StaticTblQuizQuestionRelations.TblQuestionEntityUsingQuestionIdStatic, ()=>new TblQuizQuestionRelations().TblQuestionEntityUsingQuestionId, null, new int[] { (int)TblQuizQuestionFieldIndex.QuestionId }, null, true, (int)Datalib.EntityType.TblQuestionEntity);
AddNavigatorMetaData("TblQuiz", "TblQuizQuestions", (a, b) => a._tblQuiz = b, a => a._tblQuiz, (a, b) => a.TblQuiz = b, Datalib.RelationClasses.StaticTblQuizQuestionRelations.TblQuizEntityUsingQuizIdStatic, ()=>new TblQuizQuestionRelations().TblQuizEntityUsingQuizId, null, new int[] { (int)TblQuizQuestionFieldIndex.QuizId }, null, true, (int)Datalib.EntityType.TblQuizEntity);
}
}
/// Static ctor
static TblQuizQuestionEntity()
{
}
/// CTor
public TblQuizQuestionEntity()
{
InitClassEmpty(null, null);
}
/// CTor
/// Fields object to set as the fields for this entity.
public TblQuizQuestionEntity(IEntityFields2 fields)
{
InitClassEmpty(null, fields);
}
/// CTor
/// The custom validator object for this TblQuizQuestionEntity
public TblQuizQuestionEntity(IValidator validator)
{
InitClassEmpty(validator, null);
}
/// CTor
/// PK value for TblQuizQuestion which data should be fetched into this TblQuizQuestion object
public TblQuizQuestionEntity(System.String uniqueId) : this(uniqueId, null)
{
}
/// CTor
/// PK value for TblQuizQuestion which data should be fetched into this TblQuizQuestion object
/// The custom validator object for this TblQuizQuestionEntity
public TblQuizQuestionEntity(System.String uniqueId, IValidator validator)
{
InitClassEmpty(validator, null);
this.UniqueId = uniqueId;
}
/// Private CTor for deserialization
///
///
protected TblQuizQuestionEntity(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 entity of type 'TblQuestion' to this entity.
///
public virtual IRelationPredicateBucket GetRelationInfoTblQuestion() { return CreateRelationInfoForNavigator("TblQuestion"); }
/// Creates a new IRelationPredicateBucket object which contains the predicate expression and relation collection to fetch the related entity of type 'TblQuiz' to this entity.
///
public virtual IRelationPredicateBucket GetRelationInfoTblQuiz() { return CreateRelationInfoForNavigator("TblQuiz"); }
///
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 TblQuizQuestionEntity
/// 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 TblQuizQuestionRelations Relations { get { return _relationsFactory; } }
/// Creates a new PrefetchPathElement2 object which contains all the information to prefetch the related entities of type 'TblQuestion' for this entity.
/// Ready to use IPrefetchPathElement2 implementation.
public static IPrefetchPathElement2 PrefetchPathTblQuestion { get { return _staticMetaData.GetPrefetchPathElement("TblQuestion", CommonEntityBase.CreateEntityCollection()); } }
/// 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 PrefetchPathTblQuiz { get { return _staticMetaData.GetPrefetchPathElement("TblQuiz", CommonEntityBase.CreateEntityCollection()); } }
/// The QuestionId property of the Entity TblQuizQuestion
/// Mapped on table field: "tblQuizQuestions"."QuestionID".
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 QuestionId
{
get { return (System.String)GetValue((int)TblQuizQuestionFieldIndex.QuestionId, true); }
set { SetValue((int)TblQuizQuestionFieldIndex.QuestionId, value); }
}
/// The QuizId property of the Entity TblQuizQuestion
/// Mapped on table field: "tblQuizQuestions"."QuizID".
Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32.
Table field behavior characteristics (is nullable, is PK, is identity): false, false, false
public virtual System.String QuizId
{
get { return (System.String)GetValue((int)TblQuizQuestionFieldIndex.QuizId, true); }
set { SetValue((int)TblQuizQuestionFieldIndex.QuizId, value); }
}
/// The QuizTemplateId property of the Entity TblQuizQuestion
/// Mapped on table field: "tblQuizQuestions"."QuizTemplateID".
Table field type characteristics (type, precision, scale, length): VarWChar, 0, 0, 32.
Table field behavior characteristics (is nullable, is PK, is identity): false, false, false
public virtual System.String QuizTemplateId
{
get { return (System.String)GetValue((int)TblQuizQuestionFieldIndex.QuizTemplateId, true); }
set { SetValue((int)TblQuizQuestionFieldIndex.QuizTemplateId, value); }
}
/// The TrainingTypeId property of the Entity TblQuizQuestion
/// Mapped on table field: "tblQuizQuestions"."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)TblQuizQuestionFieldIndex.TrainingTypeId, true); }
set { SetValue((int)TblQuizQuestionFieldIndex.TrainingTypeId, value); }
}
/// The UniqueId property of the Entity TblQuizQuestion
/// Mapped on table field: "tblQuizQuestions"."UniqueID".
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 UniqueId
{
get { return (System.String)GetValue((int)TblQuizQuestionFieldIndex.UniqueId, true); }
set { SetValue((int)TblQuizQuestionFieldIndex.UniqueId, value); }
}
/// Gets / sets related entity of type 'TblQuestionEntity' 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 TblQuestionEntity TblQuestion
{
get { return _tblQuestion; }
set { SetSingleRelatedEntityNavigator(value, "TblQuestion"); }
}
/// Gets / sets related entity of type 'TblQuizEntity' 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 TblQuizEntity TblQuiz
{
get { return _tblQuiz; }
set { SetSingleRelatedEntityNavigator(value, "TblQuiz"); }
}
// __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode
// __LLBLGENPRO_USER_CODE_REGION_END
}
}
namespace Datalib
{
public enum TblQuizQuestionFieldIndex
{
///QuestionId.
QuestionId,
///QuizId.
QuizId,
///QuizTemplateId.
QuizTemplateId,
///TrainingTypeId.
TrainingTypeId,
///UniqueId.
UniqueId,
///
AmountOfFields
}
}
namespace Datalib.RelationClasses
{
/// Implements the relations factory for the entity: TblQuizQuestion.
public partial class TblQuizQuestionRelations: RelationFactory
{
/// Returns a new IEntityRelation object, between TblQuizQuestionEntity and TblQuestionEntity over the m:1 relation they have, using the relation between the fields: TblQuizQuestion.QuestionId - TblQuestion.QuestionId
public virtual IEntityRelation TblQuestionEntityUsingQuestionId
{
get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.ManyToOne, "TblQuestion", false, new[] { TblQuestionFields.QuestionId, TblQuizQuestionFields.QuestionId }); }
}
/// Returns a new IEntityRelation object, between TblQuizQuestionEntity and TblQuizEntity over the m:1 relation they have, using the relation between the fields: TblQuizQuestion.QuizId - TblQuiz.QuizId
public virtual IEntityRelation TblQuizEntityUsingQuizId
{
get { return ModelInfoProviderSingleton.GetInstance().CreateRelation(RelationType.ManyToOne, "TblQuiz", false, new[] { TblQuizFields.QuizId, TblQuizQuestionFields.QuizId }); }
}
}
/// Static class which is used for providing relationship instances which are re-used internally for syncing
internal static class StaticTblQuizQuestionRelations
{
internal static readonly IEntityRelation TblQuestionEntityUsingQuestionIdStatic = new TblQuizQuestionRelations().TblQuestionEntityUsingQuestionId;
internal static readonly IEntityRelation TblQuizEntityUsingQuizIdStatic = new TblQuizQuestionRelations().TblQuizEntityUsingQuizId;
/// CTor
static StaticTblQuizQuestionRelations() { }
}
}