/// <summary>Creates a new, empty Entity object of the type specified</summary>
        /// <param name="entityTypeToCreate">The entity type to create.</param>
        /// <returns>A new, empty Entity object.</returns>
        public static IEntity Create(SD.LLBLGen.Pro.Examples.EntityType entityTypeToCreate)
        {
            var     factoryToUse = EntityFactoryFactory.GetFactory(entityTypeToCreate);
            IEntity toReturn     = null;

            if (factoryToUse != null)
            {
                toReturn = factoryToUse.Create();
            }
            return(toReturn);
        }
        /// <summary>Gets the factory of the entity with the SD.LLBLGen.Pro.Examples.EntityType specified</summary>
        /// <param name="typeOfEntity">The type of entity.</param>
        /// <returns>factory to use or null if not found</returns>
        public static IEntityFactory GetFactory(SD.LLBLGen.Pro.Examples.EntityType typeOfEntity)
        {
            switch (typeOfEntity)
            {
            case SD.LLBLGen.Pro.Examples.EntityType.CategoryEntity:
                return(new CategoryEntityFactory());

            case SD.LLBLGen.Pro.Examples.EntityType.CustomerEntity:
                return(new CustomerEntityFactory());

            case SD.LLBLGen.Pro.Examples.EntityType.CustomerCustomerDemoEntity:
                return(new CustomerCustomerDemoEntityFactory());

            case SD.LLBLGen.Pro.Examples.EntityType.CustomerDemographyEntity:
                return(new CustomerDemographyEntityFactory());

            case SD.LLBLGen.Pro.Examples.EntityType.EmployeeEntity:
                return(new EmployeeEntityFactory());

            case SD.LLBLGen.Pro.Examples.EntityType.EmployeeTerritoryEntity:
                return(new EmployeeTerritoryEntityFactory());

            case SD.LLBLGen.Pro.Examples.EntityType.OrderEntity:
                return(new OrderEntityFactory());

            case SD.LLBLGen.Pro.Examples.EntityType.OrderDetailEntity:
                return(new OrderDetailEntityFactory());

            case SD.LLBLGen.Pro.Examples.EntityType.ProductEntity:
                return(new ProductEntityFactory());

            case SD.LLBLGen.Pro.Examples.EntityType.RegionEntity:
                return(new RegionEntityFactory());

            case SD.LLBLGen.Pro.Examples.EntityType.ShipperEntity:
                return(new ShipperEntityFactory());

            case SD.LLBLGen.Pro.Examples.EntityType.SupplierEntity:
                return(new SupplierEntityFactory());

            case SD.LLBLGen.Pro.Examples.EntityType.TerritoryEntity:
                return(new TerritoryEntityFactory());

            default:
                return(null);
            }
        }
        /// <summary>Creates a new entity collection</summary>
        /// <param name="typeToUse">The entity type to create the collection for.</param>
        /// <returns>A new entity collection object.</returns>
        public static IEntityCollection Create(SD.LLBLGen.Pro.Examples.EntityType typeToUse)
        {
            switch (typeToUse)
            {
            case SD.LLBLGen.Pro.Examples.EntityType.CategoryEntity:
                return(new CategoryCollection());

            case SD.LLBLGen.Pro.Examples.EntityType.CustomerEntity:
                return(new CustomerCollection());

            case SD.LLBLGen.Pro.Examples.EntityType.CustomerCustomerDemoEntity:
                return(new CustomerCustomerDemoCollection());

            case SD.LLBLGen.Pro.Examples.EntityType.CustomerDemographyEntity:
                return(new CustomerDemographyCollection());

            case SD.LLBLGen.Pro.Examples.EntityType.EmployeeEntity:
                return(new EmployeeCollection());

            case SD.LLBLGen.Pro.Examples.EntityType.EmployeeTerritoryEntity:
                return(new EmployeeTerritoryCollection());

            case SD.LLBLGen.Pro.Examples.EntityType.OrderEntity:
                return(new OrderCollection());

            case SD.LLBLGen.Pro.Examples.EntityType.OrderDetailEntity:
                return(new OrderDetailCollection());

            case SD.LLBLGen.Pro.Examples.EntityType.ProductEntity:
                return(new ProductCollection());

            case SD.LLBLGen.Pro.Examples.EntityType.RegionEntity:
                return(new RegionCollection());

            case SD.LLBLGen.Pro.Examples.EntityType.ShipperEntity:
                return(new ShipperCollection());

            case SD.LLBLGen.Pro.Examples.EntityType.SupplierEntity:
                return(new SupplierCollection());

            case SD.LLBLGen.Pro.Examples.EntityType.TerritoryEntity:
                return(new TerritoryCollection());

            default:
                return(null);
            }
        }
Exemple #4
0
 /// <summary>Gets the factory of the entity with the SD.LLBLGen.Pro.Examples.EntityType specified</summary>
 /// <param name="typeOfEntity">The type of entity.</param>
 /// <returns>factory to use or null if not found</returns>
 public static IEntityFactory2 GetFactory(SD.LLBLGen.Pro.Examples.EntityType typeOfEntity)
 {
     return(GetFactory(GeneralEntityFactory.Create(typeOfEntity).GetType()));
 }
Exemple #5
0
        /// <summary>Creates a new, empty Entity object of the type specified</summary>
        /// <param name="entityTypeToCreate">The entity type to create.</param>
        /// <returns>A new, empty Entity object.</returns>
        public static IEntity2 Create(SD.LLBLGen.Pro.Examples.EntityType entityTypeToCreate)
        {
            IEntityFactory2 factoryToUse = null;

            switch (entityTypeToCreate)
            {
            case SD.LLBLGen.Pro.Examples.EntityType.CategoryEntity:
                factoryToUse = new CategoryEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.EntityType.CustomerEntity:
                factoryToUse = new CustomerEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.EntityType.CustomerCustomerDemoEntity:
                factoryToUse = new CustomerCustomerDemoEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.EntityType.CustomerDemographyEntity:
                factoryToUse = new CustomerDemographyEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.EntityType.EmployeeEntity:
                factoryToUse = new EmployeeEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.EntityType.EmployeeTerritoryEntity:
                factoryToUse = new EmployeeTerritoryEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.EntityType.OrderEntity:
                factoryToUse = new OrderEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.EntityType.OrderDetailEntity:
                factoryToUse = new OrderDetailEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.EntityType.ProductEntity:
                factoryToUse = new ProductEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.EntityType.RegionEntity:
                factoryToUse = new RegionEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.EntityType.ShipperEntity:
                factoryToUse = new ShipperEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.EntityType.SupplierEntity:
                factoryToUse = new SupplierEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.EntityType.TerritoryEntity:
                factoryToUse = new TerritoryEntityFactory();
                break;
            }
            IEntity2 toReturn = null;

            if (factoryToUse != null)
            {
                toReturn = factoryToUse.Create();
            }
            return(toReturn);
        }
Exemple #6
0
 /// <summary>CTor</summary>
 /// <param name="entityName">Name of the entity.</param>
 /// <param name="typeOfEntity">The type of entity.</param>
 /// <param name="isInHierarchy">If true, the entity of this factory is in an inheritance hierarchy, false otherwise</param>
 public EntityFactoryBase2(string entityName, SD.LLBLGen.Pro.Examples.EntityType typeOfEntity, bool isInHierarchy) : base(entityName)
 {
     _typeOfEntity  = typeOfEntity;
     _isInHierarchy = isInHierarchy;
 }
 /// <summary>CTor</summary>
 /// <param name="entityName">Name of the entity.</param>
 /// <param name="typeOfEntity">The type of entity.</param>
 public EntityFactoryBase(string entityName, SD.LLBLGen.Pro.Examples.EntityType typeOfEntity) : base(entityName)
 {
     _typeOfEntity = typeOfEntity;
 }
Exemple #8
0
 /// <summary>Initializes a new instance of the <see cref="DynamicRelation"/> class.</summary>
 /// <param name="leftOperand">The left operand which is a field.</param>
 /// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param>
 /// <param name="rightOperand">The right operand which is an entity.</param>
 /// <param name="aliasLeftOperand">The alias of the left operand. If you don't want to / need to alias the left operand (only alias if you have to), specify string.Empty.</param>
 /// <param name="aliasRightOperand">The alias of the right operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
 /// <param name="onClause">The on clause for the join.</param>
 public DynamicRelation(IEntityFieldCore leftOperand, JoinHint joinType, SD.LLBLGen.Pro.Examples.EntityType rightOperand, string aliasLeftOperand, string aliasRightOperand, IPredicate onClause)
 {
     this.InitClass(joinType, aliasLeftOperand, aliasRightOperand, onClause, leftOperand, GeneralEntityFactory.Create(rightOperand));
 }
Exemple #9
0
 /// <summary>Initializes a new instance of the <see cref="DynamicRelation"/> class.</summary>
 /// <param name="leftOperand">The left operand.</param>
 /// <param name="joinType">Type of the join. If None is specified, Inner is assumed.</param>
 /// <param name="rightOperand">The right operand which is an entity type.</param>
 /// <param name="aliasRightOperand">The alias of the right operand. If you don't want to / need to alias the right operand (only alias if you have to), specify string.Empty.</param>
 /// <param name="onClause">The on clause for the join.</param>
 public DynamicRelation(DerivedTableDefinition leftOperand, JoinHint joinType, SD.LLBLGen.Pro.Examples.EntityType rightOperand, string aliasRightOperand, IPredicate onClause)
 {
     this.InitClass(joinType, string.Empty, aliasRightOperand, onClause, leftOperand, GeneralEntityFactory.Create(rightOperand));
 }
Exemple #10
0
 /// <summary>General factory entrance method which will return an EntityFields object with the format generated by the factory specified</summary>
 /// <param name="relatedEntityType">The type of entity the fields are for</param>
 /// <returns>The IEntityFields instance requested</returns>
 public static IEntityFields CreateEntityFieldsObject(SD.LLBLGen.Pro.Examples.EntityType relatedEntityType)
 {
     return(ModelInfoProviderSingleton.GetInstance().GetEntityFields(_entityTypeNamesCache[relatedEntityType], PersistenceInfoProviderSingleton.GetInstance()));
 }