c# - Implement a "cancel" button on forms that use databinding and nhibernate -
i use nhibernate access mysql database, , have many -winforms- forms using databinding modify properties of objects. there many –nhibernate- objects created/deleted during time forms used.
i need implement "cancel" button on forms.
i can defer creation/deletion of objects on database (nhibernate’s session.save/delete) moment form closing. don’t know changing of loaded objects’ properties directly user (changed winforms databinding) or adding/removing of objects related objects collections.
i’m not nhibernate expert @ all. there way mark a referenced object “not loaded yet”, force refresh db next time referenced in way (collections , properties) without losing reference (kind of return reference proxy object initial state, before first load db)?
i’m not winforms expert @ neither. how can know objects changed through databinding?
i guess simple approach use inotifypropertychanged on entities , inotifycollectionchanged or use collection implements it. can subscribe events and, @ least know, if had changed.
in case aspect of presentation hear opinions on.
Comments
Post a Comment