/// <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(BlazorTests.Server.Entities.EntityType entityTypeToCreate) { IEntityFactory2 factoryToUse = null; switch (entityTypeToCreate) { case BlazorTests.Server.Entities.EntityType.CustomerEntity: factoryToUse = new CustomerEntityFactory(); break; case BlazorTests.Server.Entities.EntityType.CustomerTypeEntity: factoryToUse = new CustomerTypeEntityFactory(); break; } IEntity2 toReturn = null; if (factoryToUse != null) { toReturn = factoryToUse.Create(); } return(toReturn); }
/// <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, BlazorTests.Server.Entities.EntityType typeOfEntity, bool isInHierarchy) : base(entityName) { _typeOfEntity = typeOfEntity; _isInHierarchy = isInHierarchy; }
/// <summary>Gets the factory of the entity with the BlazorTests.Server.Entities.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(BlazorTests.Server.Entities.EntityType typeOfEntity) { return(GetFactory(GeneralEntityFactory.Create(typeOfEntity).GetType())); }