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

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -