/// <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(Northwind.SSDAL.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 Northwind.SSDAL.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(Northwind.SSDAL.EntityType typeOfEntity) { return(GetFactory(GeneralEntityFactory.Create(typeOfEntity).GetType())); }
/// <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(Northwind.SSDAL.EntityType entityTypeToCreate) { IEntityFactory factoryToUse = null; switch (entityTypeToCreate) { case Northwind.SSDAL.EntityType.AuditActionTypeEntity: factoryToUse = new AuditActionTypeEntityFactory(); break; case Northwind.SSDAL.EntityType.AuditInfoEntity: factoryToUse = new AuditInfoEntityFactory(); break; case Northwind.SSDAL.EntityType.CategoryEntity: factoryToUse = new CategoryEntityFactory(); break; case Northwind.SSDAL.EntityType.CustomerEntity: factoryToUse = new CustomerEntityFactory(); break; case Northwind.SSDAL.EntityType.CustomerCustomerDemoEntity: factoryToUse = new CustomerCustomerDemoEntityFactory(); break; case Northwind.SSDAL.EntityType.CustomerDemographicEntity: factoryToUse = new CustomerDemographicEntityFactory(); break; case Northwind.SSDAL.EntityType.EmployeeEntity: factoryToUse = new EmployeeEntityFactory(); break; case Northwind.SSDAL.EntityType.EmployeeTerritoryEntity: factoryToUse = new EmployeeTerritoryEntityFactory(); break; case Northwind.SSDAL.EntityType.GroupEntity: factoryToUse = new GroupEntityFactory(); break; case Northwind.SSDAL.EntityType.OrderEntity: factoryToUse = new OrderEntityFactory(); break; case Northwind.SSDAL.EntityType.OrderAuditInfoEntity: factoryToUse = new OrderAuditInfoEntityFactory(); break; case Northwind.SSDAL.EntityType.OrderDetailEntity: factoryToUse = new OrderDetailEntityFactory(); break; case Northwind.SSDAL.EntityType.ProductEntity: factoryToUse = new ProductEntityFactory(); break; case Northwind.SSDAL.EntityType.RegionEntity: factoryToUse = new RegionEntityFactory(); break; case Northwind.SSDAL.EntityType.ShipperEntity: factoryToUse = new ShipperEntityFactory(); break; case Northwind.SSDAL.EntityType.SupplierEntity: factoryToUse = new SupplierEntityFactory(); break; case Northwind.SSDAL.EntityType.TerritoryEntity: factoryToUse = new TerritoryEntityFactory(); break; case Northwind.SSDAL.EntityType.UserEntity: factoryToUse = new UserEntityFactory(); break; case Northwind.SSDAL.EntityType.UserGroupEntity: factoryToUse = new UserGroupEntityFactory(); break; } IEntity toReturn = null; if (factoryToUse != null) { toReturn = factoryToUse.Create(); } return(toReturn); }
/// <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(Northwind.SSDAL.EntityType typeToUse) { switch (typeToUse) { case Northwind.SSDAL.EntityType.AuditActionTypeEntity: return(new AuditActionTypeCollection()); case Northwind.SSDAL.EntityType.AuditInfoEntity: return(new AuditInfoCollection()); case Northwind.SSDAL.EntityType.CategoryEntity: return(new CategoryCollection()); case Northwind.SSDAL.EntityType.CustomerEntity: return(new CustomerCollection()); case Northwind.SSDAL.EntityType.CustomerCustomerDemoEntity: return(new CustomerCustomerDemoCollection()); case Northwind.SSDAL.EntityType.CustomerDemographicEntity: return(new CustomerDemographicCollection()); case Northwind.SSDAL.EntityType.EmployeeEntity: return(new EmployeeCollection()); case Northwind.SSDAL.EntityType.EmployeeTerritoryEntity: return(new EmployeeTerritoryCollection()); case Northwind.SSDAL.EntityType.GroupEntity: return(new GroupCollection()); case Northwind.SSDAL.EntityType.OrderEntity: return(new OrderCollection()); case Northwind.SSDAL.EntityType.OrderAuditInfoEntity: return(new OrderAuditInfoCollection()); case Northwind.SSDAL.EntityType.OrderDetailEntity: return(new OrderDetailCollection()); case Northwind.SSDAL.EntityType.ProductEntity: return(new ProductCollection()); case Northwind.SSDAL.EntityType.RegionEntity: return(new RegionCollection()); case Northwind.SSDAL.EntityType.ShipperEntity: return(new ShipperCollection()); case Northwind.SSDAL.EntityType.SupplierEntity: return(new SupplierCollection()); case Northwind.SSDAL.EntityType.TerritoryEntity: return(new TerritoryCollection()); case Northwind.SSDAL.EntityType.UserEntity: return(new UserCollection()); case Northwind.SSDAL.EntityType.UserGroupEntity: return(new UserGroupCollection()); default: return(null); } }
/// <summary>CTor</summary> /// <param name="entityName">Name of the entity.</param> /// <param name="typeOfEntity">The type of entity.</param> public EntityFactoryBase(string entityName, Northwind.SSDAL.EntityType typeOfEntity) : base(entityName) { _typeOfEntity = typeOfEntity; }
/// <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(Northwind.SSDAL.EntityType relatedEntityType) { return(ModelInfoProviderSingleton.GetInstance().GetEntityFields(_entityTypeNamesCache[relatedEntityType], PersistenceInfoProviderSingleton.GetInstance())); }
/// <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, Northwind.SSDAL.EntityType rightOperand, string aliasLeftOperand, string aliasRightOperand, IPredicate onClause) { this.InitClass(joinType, aliasLeftOperand, aliasRightOperand, onClause, leftOperand, GeneralEntityFactory.Create(rightOperand)); }
/// <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, Northwind.SSDAL.EntityType rightOperand, string aliasRightOperand, IPredicate onClause) { this.InitClass(joinType, string.Empty, 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">Flag whether the entity to produce is in an inheritance hierarchy</param> public EntityFactoryBase(string entityName, Northwind.SSDAL.EntityType typeOfEntity, bool isInHierarchy) : base(entityName, (int)typeOfEntity) { _typeOfEntity = typeOfEntity; _isInHierarchy = isInHierarchy; }