Generic TypeConverter

Posts   
 
    
Posts: 30
Joined: 17-Sep-2006
# Posted on: 21-Aug-2007 17:32:20   

As I have a number of Enum's that I wanted to be used in database fields, I thought I'd create a generic version of the TypeConverter described at http://llblgen.com/TinyForum/Messages.aspx?ThreadID=7355

I then create a concrete version of the class for each enumeration I want to work with, such as

public class UserCreateStatusTypeConverter : EnumTypeConverter<UserCreateStatus> {

}

LLBLGen doesn't seem to pick up this type (with the intermediate generic EnumTypeConverter class), but it picks up a non-generic converter class that derives directly from the TypeConverter fine. Is there any way to get it to do so?

Cheers

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 22-Aug-2007 12:55:12   

It does a search for types which derive from the base class TypeConverter, and uses all types which do. Apparently generic types aren't reported by the reflection although I have no idea why. Perhaps our discovery routine is flawed in that it doesn't pick up types which derive indirectly from typeconverter. I'll check it out.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 24-Aug-2007 12:27:45   

It's a bug in the type converter discovery routine: when it runs into a generic type converter, it gets an exception when it creates an instance of the type converter, as the generic type parameter (<T> )isn't specified obviously. It should ignore these type converter classes. As it gets an exception, it ignores the assembly and moves on. The exception isn't shown as it is of no use to the user.

Fixed in next build of v2.5

Frans Bouma | Lead developer LLBLGen Pro
Posts: 30
Joined: 17-Sep-2006
# Posted on: 24-Aug-2007 13:46:02   

Great, Thanks Otis!

How do I get hold of the latest build? Do you release this on the main downloads page?

Cheers

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39910
Joined: 17-Aug-2003
# Posted on: 24-Aug-2007 13:52:38   

james.crowley wrote:

Great, Thanks Otis!

How do I get hold of the latest build? Do you release this on the main downloads page?

Cheers

We'll release a new build of v2.5 on sunday or monday. You'll be able to download it from the customer area simple_smile

Frans Bouma | Lead developer LLBLGen Pro