Hi!
I'm dealing with an object implementing the System.Security.Principal.IIdentity interface. I would like to persist my object through NHibernate, and currently that's not the problem.
The thing is, that I would not like to store the password with my object, that is, I would not like to have to make a MyIdentity.Password property. Still, I would like to authenticate an identity using the password. So, having my ISession object, how can I add the password as a criteria to select the identity from the database, eventhough there is no Password property on my object?
I thought about using the Expression.Sql method, but is there a cleaner approach? Would it be a nicer approach to just create the before mentioned property, since I'll also need it if there's a need to change and persist the password?
Thanks in advance,
Patrick
|