示例#1
0
        /// <summary>Gets the factory of the entity with the SD.LLBLGen.Pro.Examples.Authorization.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.Authorization.EntityType typeOfEntity)
        {
            switch (typeOfEntity)
            {
            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.CustomersEntity:
                return(new CustomersEntityFactory());

            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.EmployeesEntity:
                return(new EmployeesEntityFactory());

            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.GroupEntity:
                return(new GroupEntityFactory());

            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.OrderDetailsEntity:
                return(new OrderDetailsEntityFactory());

            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.OrdersEntity:
                return(new OrdersEntityFactory());

            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.UserEntity:
                return(new UserEntityFactory());

            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.UserGroupEntity:
                return(new UserGroupEntityFactory());

            default:
                return(null);
            }
        }
示例#2
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.Authorization.EntityType entityTypeToCreate)
        {
            var      factoryToUse = EntityFactoryFactory.GetFactory(entityTypeToCreate);
            IEntity2 toReturn     = null;

            if (factoryToUse != null)
            {
                toReturn = factoryToUse.Create();
            }
            return(toReturn);
        }
示例#3
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.Authorization.EntityType entityTypeToCreate)
        {
            IEntityFactory2 factoryToUse = null;

            switch (entityTypeToCreate)
            {
            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.CustomersEntity:
                factoryToUse = new CustomersEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.EmployeesEntity:
                factoryToUse = new EmployeesEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.GroupEntity:
                factoryToUse = new GroupEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.OrderDetailsEntity:
                factoryToUse = new OrderDetailsEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.OrdersEntity:
                factoryToUse = new OrdersEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.UserEntity:
                factoryToUse = new UserEntityFactory();
                break;

            case SD.LLBLGen.Pro.Examples.Authorization.EntityType.UserGroupEntity:
                factoryToUse = new UserGroupEntityFactory();
                break;
            }
            IEntity2 toReturn = null;

            if (factoryToUse != null)
            {
                toReturn = factoryToUse.Create();
            }
            return(toReturn);
        }
示例#4
0
 /// <summary>Gets the factory of the entity with the SD.LLBLGen.Pro.Examples.Authorization.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.Authorization.EntityType typeOfEntity)
 {
     return(GetFactory(GeneralEntityFactory.Create(typeOfEntity).GetType()));
 }
示例#5
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.Authorization.EntityType typeOfEntity, bool isInHierarchy) : base(entityName)
 {
     _typeOfEntity  = typeOfEntity;
     _isInHierarchy = isInHierarchy;
 }
示例#6
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.Authorization.EntityType rightOperand, string aliasLeftOperand, string aliasRightOperand, IPredicate onClause)
 {
     this.InitClass(joinType, aliasLeftOperand, aliasRightOperand, onClause, leftOperand, GeneralEntityFactory.Create(rightOperand));
 }
示例#7
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.Authorization.EntityType rightOperand, string aliasRightOperand, IPredicate onClause)
 {
     this.InitClass(joinType, string.Empty, aliasRightOperand, onClause, leftOperand, GeneralEntityFactory.Create(rightOperand));
 }