tags:

views:

22

answers:

0

Ok, I have a question. I have 3-tier project. Dal => Domain => UI. design choice is not to expose domain objects (business classes) to the ui, but to use DTO. I am trying to build a Query engine that takes parameters from the ui layer and converts into the NHibernate criteria api on the dal layer. The point is the ui layer does not known of the domain classes (only DTO) and I don't want to use strings to specify whitch property to query by. So far I have done this.

QueryObject query = new QueryObject()
query.Criteria.Add(QueryCriteria.Equals("Name", "TestName"));

I need advice how to best replace the "magic" strings from the query for PropertyNames.(the first parameter in Equals)

Thanks