Can I use a common field name when making predicates?

Posts   
 
    
mattroid
User
Posts: 1
Joined: 10-May-2007
# Posted on: 10-May-2007 22:52:58   
  • I've got three typed views, each start with the same first four columns.
  • Each typed view is accessed in seperate user controls
  • I want the parent page to filter the grid for a user control with out having to know which typed view is being used. I would like to just create a generic predicate object that any of the three user controls can get and use to filter their typed views. But when creating a predicate you must specify the tablename and the field name. Well, my problem is that the parent page doesn't know what the table name (or view) the child control is using, but it does know that what ever view it is using it wants to filter by AgencyCode.

Can I make the views inherit from a common view or something? Or can I construct a generic field name to use in my predicates? I've tried doing both, but could not figure out how to make it work.

--matto

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 11-May-2007 10:57:25   

I think you need to use something like Activator.CreateInstance to get an instance of an entity and/or entityField at runtime by its type. As shown in the following thread: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=7299