How to do downcasting in nhibernate inheritance -
i have 2 classes manager , employee, , 2 tables them in database. manager class inherits employee class. want convert employee manager. there way can in nhibernate?
public class employee { public virtual string name { get; set; } } public class manager : employee { public virtual string cabinnumber { get; set; } }
and want convert employee id employeeid
manager , save in database:
var employee = repository.get<domainmodel.models.sadhak>(employeeid); domainmodel.models.manager manager = (domainmodel.models.manager) employee; manager.cabinnumber = "a65"; session.delete(employee); session.saveorupdate(manager);
there no way in nhibernate, assumes once have created entity, of type.
Comments
Post a Comment