mercredi 8 février 2017

F# Reflection on types created with TypeProvider

I've created multiple types with type providers, these are used to create record types. In the next stage of my project, I want to use reflection to build these records. But the problem here is that every type that's created now has the type of System.Object.

So for example, all the members have a type provider type. (Minlength,Email and Required are all type providers I created).

type UserT = {
       Name: MinLength
       email : Email
       password : Required
       }

when I late use reflection on this i get the following result

val refl : PropertyInfo [] =
[|System.Object Name; System.Object email; System.Object password|]

Is it possible to use reflection to get the correct type of these members?

thx!





Aucun commentaire:

Enregistrer un commentaire