Пример #1
0
 public EntityDataSourceBase()
 {
     EntityTypeName      = typeof(TEntity).Name;
     EntityFactoryToUse  = EntityFactoryFactory.GetFactory(typeof(TEntity));
     EntityTypeEnumValue = (EntityType)Enum.Parse(typeof(EntityType), EntityTypeName, true);
     Adapter             = new DataAccessAdapter(ConnectionString);
 }
Пример #2
0
 /// <summary>Creates the entity collection for the types specified</summary>
 /// <typeparam name="T">type of the element to store in the collection</typeparam>
 protected static EntityCollection <T> CreateEntityCollection <T>()
     where T : EntityBase2, IEntity2
 {
     return(new EntityCollection <T>(EntityFactoryFactory.GetFactory(typeof(T))));
 }
Пример #3
0
        /// <summary>
        /// Gets the .NET type from the AQD.Model.EntityType specified.
        /// </summary>
        /// <param name="typeOfEntity">The type of entity.</param>
        /// <returns>.NET type fo the entity or null if not found</returns>
        public static Type GetTypeFromEntityTypeEnum(EntityType typeOfEntity)
        {
            var ef = EntityFactoryFactory.GetFactory(typeOfEntity);

            return(ef != null?ef.Create().GetType() : null);
        }
Пример #4
0
 /// <summary>Gets the factory of the entity with the .NET type specified</summary>
 /// <param name="typeOfEntity">The type of entity.</param>
 /// <returns>factory to use or null if not found</returns>
 public static IEntityFactory GetFactory(Type typeOfEntity)
 {
     return(EntityFactoryFactory.GetFactory(typeOfEntity));
 }
Пример #5
0
 /// <summary>Gets the factory of the entity with the integer version of AQD.Model.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(int typeOfEntity)
 {
     return(EntityFactoryFactory.GetFactory((EntityType)typeOfEntity));
 }
Пример #6
0
 /// <summary>Gets the factory of the entity with the EntityTypeName specified</summary>
 /// <param name="typeOfEntity">The type of entity.</param>
 /// <returns>factory to use or null if not found</returns>
 public static IEntityFactory GetFactory(string typeOfEntity)
 {
     return(EntityFactoryFactory.GetFactory(typeOfEntity.ToEnum <EntityType>()));
 }
Пример #7
0
 /// <inheritdoc/>
 protected override IEntityFactory GetEntityFactoryFromCache(int entityTypeEnumValue)
 {
     return(EntityFactoryFactory.GetFactory((SD.LLBLGen.Pro.Examples.EntityType)entityTypeEnumValue));
 }
 /// <inheritdoc/>
 protected override IEntityFactory GetEntityFactoryFromCache(int entityTypeEnumValue)
 {
     return(EntityFactoryFactory.GetFactory((Northwind.SSDAL.EntityType)entityTypeEnumValue));
 }