I would like to use NHibernate to query a database with different objects. I have a string and depending on what that string is then I would like to return an object and query the db using that object. However, I am not sure what the best design of this would be.
Simple logic:
public object CheckString(string s){
if(s == "A")
return objA;
else if(s == "B")
return objB;
}
public void main(){
var obj = CheckString("A");
session.CreateCriteria<obj>().List<obj>();
}