OK, I think you have two options:
1. Return the Admin object instead of a bool and check if it's null in the calling code.
2. Refactor the method to pass it an Admin object as an out parameter, similarly to the framework TryParse methods:
public bool TryAuthenticateAdmin(out Admin admin) { ... }
Flush is called when you are done with a session and want to persist changes to the data store. If there are no changes then there's nothing to persist.
Konnekt wrote:
well i didnt write the topic title right.. the point of this is i got a admin login, now they got roles of access.. what i want to do is just a simple login select.. but i want to be able to save the role of the admin in a authicationticket later on..
this gets that the admin is valid and return a bool.. what im tryn to figure how to do so get the admin that is valid, so i can access its role in the codebehind? you know how i mean? this dont return the admin as a admin objec just a bool...
im a newbie at nhibernate so i use the flush for all i do.. the vid i seen does it so i asume that was how it was done.. ill look at it more then..