Beautiful! Thanks Fabio :-) On Fri, Jan 8, 2010 at 5:04 AM, Fabio Maulo <[email protected]> wrote:
> there is an example in uNhAddIns > http://code.google.com/p/unhaddins/ > > <http://code.google.com/p/unhaddins/>I can't send the link to the specific > source because the GoogleCode source-browser is broken. > The folder is trunk\uNhAddIns\uNhAddIns\UserTypes and the source > is GenericWellKnownInstanceType.cs > > 2010/1/8 ajaishankar <[email protected]> > >> Hi >> >> I have a generic class that I need to persist as a string. Is this >> possible using IUserType? >> >> For ReturnedType - can I pass an open generic or say an interface? >> >> Also in NullSafeGet how do I create an instance of the correct type - >> I'm thinking saving the type along with the data maybe? >> >> Ajai >> >> interface I { string SaveMe { get; set; } >> >> class My<T> : I { >> string SaveMe { get; set; } >> } >> >> class Entity { >> My<int> Property; >> } >> >> class MyUserType : IUserType >> { >> public System.Type ReturnedType >> { >> get { >> return typeof(My<>); does this work ? >> return typeof(I); is this the correct way? >> } >> } >> >> public object NullSafeGet(IDataReader rs, string[] names, object >> owner) >> { >> string value = >> (string)NHibernateUtil.String.NullSafeGet(rs, names >> [0]); >> return new what? // can I somehow get the closed type of >> property >> } >> } >> >> -- >> You received this message because you are subscribed to the Google Groups >> "nhusers" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<nhusers%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/nhusers?hl=en. >> >> >> >> > > > -- > Fabio Maulo > > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > >--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
