/// <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(TournamentManager.DAL.EntityType entityTypeToCreate) { var factoryToUse = EntityFactoryFactory.GetFactory(entityTypeToCreate); IEntity2 toReturn = null; if (factoryToUse != null) { toReturn = factoryToUse.Create(); } return(toReturn); }
/// <summary>Gets the factory of the entity with the TournamentManager.DAL.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(TournamentManager.DAL.EntityType typeOfEntity) { switch (typeOfEntity) { case TournamentManager.DAL.EntityType.AvailableMatchDateEntity: return(new AvailableMatchDateEntityFactory()); case TournamentManager.DAL.EntityType.ExcludeMatchDateEntity: return(new ExcludeMatchDateEntityFactory()); case TournamentManager.DAL.EntityType.IdentityRoleEntity: return(new IdentityRoleEntityFactory()); case TournamentManager.DAL.EntityType.IdentityRoleClaimEntity: return(new IdentityRoleClaimEntityFactory()); case TournamentManager.DAL.EntityType.IdentityUserClaimEntity: return(new IdentityUserClaimEntityFactory()); case TournamentManager.DAL.EntityType.IdentityUserLoginEntity: return(new IdentityUserLoginEntityFactory()); case TournamentManager.DAL.EntityType.IdentityUserRoleEntity: return(new IdentityUserRoleEntityFactory()); case TournamentManager.DAL.EntityType.IdentityUserTokenEntity: return(new IdentityUserTokenEntityFactory()); case TournamentManager.DAL.EntityType.ManagerOfTeamEntity: return(new ManagerOfTeamEntityFactory()); case TournamentManager.DAL.EntityType.MatchEntity: return(new MatchEntityFactory()); case TournamentManager.DAL.EntityType.MatchRuleEntity: return(new MatchRuleEntityFactory()); case TournamentManager.DAL.EntityType.PlayerInTeamEntity: return(new PlayerInTeamEntityFactory()); case TournamentManager.DAL.EntityType.RankingEntity: return(new RankingEntityFactory()); case TournamentManager.DAL.EntityType.RegistrationEntity: return(new RegistrationEntityFactory()); case TournamentManager.DAL.EntityType.RoundEntity: return(new RoundEntityFactory()); case TournamentManager.DAL.EntityType.RoundLegEntity: return(new RoundLegEntityFactory()); case TournamentManager.DAL.EntityType.RoundTypeEntity: return(new RoundTypeEntityFactory()); case TournamentManager.DAL.EntityType.SetEntity: return(new SetEntityFactory()); case TournamentManager.DAL.EntityType.SetRuleEntity: return(new SetRuleEntityFactory()); case TournamentManager.DAL.EntityType.TeamEntity: return(new TeamEntityFactory()); case TournamentManager.DAL.EntityType.TeamInRoundEntity: return(new TeamInRoundEntityFactory()); case TournamentManager.DAL.EntityType.TournamentEntity: return(new TournamentEntityFactory()); case TournamentManager.DAL.EntityType.TournamentTypeEntity: return(new TournamentTypeEntityFactory()); case TournamentManager.DAL.EntityType.UserEntity: return(new UserEntityFactory()); case TournamentManager.DAL.EntityType.VenueEntity: return(new VenueEntityFactory()); default: return(null); } }
/// <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, TournamentManager.DAL.EntityType rightOperand, string aliasLeftOperand, string aliasRightOperand, IPredicate onClause) { this.InitClass(joinType, aliasLeftOperand, aliasRightOperand, onClause, leftOperand, GeneralEntityFactory.Create(rightOperand)); }
/// <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, TournamentManager.DAL.EntityType typeOfEntity, bool isInHierarchy) : base(entityName) { _typeOfEntity = typeOfEntity; _isInHierarchy = isInHierarchy; }
/// <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, TournamentManager.DAL.EntityType rightOperand, string aliasRightOperand, IPredicate onClause) { this.InitClass(joinType, string.Empty, aliasRightOperand, onClause, leftOperand, GeneralEntityFactory.Create(rightOperand)); }