////////////////////////////////////////////////////////////// // 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 Datalib.HelperClasses; using Datalib.FactoryClasses; using SD.LLBLGen.Pro.ORMSupportClasses; using System.Runtime.Serialization; namespace Datalib.EntityClasses { // __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces // __LLBLGENPRO_USER_CODE_REGION_END /// Common base class which is the base class for all generated entities which aren't a subtype of another entity. [Serializable] public abstract partial class CommonEntityBase : EntityBase2 // __LLBLGENPRO_USER_CODE_REGION_START AdditionalInterfaces // __LLBLGENPRO_USER_CODE_REGION_END { // __LLBLGENPRO_USER_CODE_REGION_START PrivateMembers // __LLBLGENPRO_USER_CODE_REGION_END /// CTor protected CommonEntityBase() {} /// Protected CTor for deserialization /// /// protected CommonEntityBase(SerializationInfo info, StreamingContext context) : base(info, context) { // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END } /// Creates the entity collection and stores it in destination if destination is null /// type of the element to store in the collection /// The type of the factory to pass to the entitycollection ctor. /// Name of the property this collection is for. /// if set to the collection is for an 1:n relationship, and the containing entity info has to be set /// if set to the collection is for an m:n relationship, otherwise for an 1:n relationship /// The destination member variable. /// the collection referred to by destination if destination isn't null, otherwise the newly created collection (which is then stored in destination protected EntityCollection GetOrCreateEntityCollection(string navigatorName, bool setContainingEntityInfo, bool forMN, ref EntityCollection destination) where T:EntityBase2, IEntity2 { if(destination==null) { destination = new EntityCollection(EntityFactoryCache2.GetEntityFactory(typeof(TFactory))); if(forMN) { ((IEntityCollectionCore)destination).IsForMN = true; } else { if(setContainingEntityInfo) { destination.SetContainingEntityInfo(this, navigatorName); } } destination.ActiveContext = this.ActiveContext; } return destination; } /// protected override IInheritanceInfoProvider GetInheritanceInfoProvider() { return ModelInfoProviderSingleton.GetInstance(); } /// protected override ITypeDefaultValue CreateTypeDefaultValueProvider() { return new TypeDefaultValue(); } /// protected override IEntityCollection2 CreateEntityCollectionForType() { return CommonEntityBase.CreateEntityCollection(); } /// Creates the entity collection for the types specified /// type of the element to store in the collection protected static EntityCollection CreateEntityCollection() where T:EntityBase2, IEntity2 { return new EntityCollection(EntityFactoryFactory.GetFactory(typeof(T))); } /// protected override Type LLBLGenProEntityTypeEnumType { get { return typeof(Datalib.EntityType); } } // __LLBLGENPRO_USER_CODE_REGION_START CustomEntityCode // __LLBLGENPRO_USER_CODE_REGION_END } }