November Happy Hour will be moved to Thursday December 5th.

Handling attributes in custom made query class

Vote:
 
Hi,
I have created a custom subclass of TopicQuery and need to know how to pass attributes to the sql below:
public class MyTopicQuery : TopicQuery
{		
public override string GetQuery()
{
return @"select topic FROM EPiServer.Community.Forum.Topic as topic where topic['TheAttributeName'] = '" + ?? +"'";
	}
}
 
-------------------------------------
This is how I pass the attribute parameter
.
.
var rq = new MyTopicQuery();
var MyCriteria = new StringCriterion();

MyCriteria.Value = "hello world";
rq["TheAttributeName"] = MyCriteria;
..
----------------------------------
How do I do this? Any ideas are welcomed.
 
/Sang
 
#56402
Jan 20, 2012 10:55
Vote:
 

Case closed, by implementing the query in the "ordinary" way you can get the query by calling the GetQuery() method and customize it the way you want.

#56446
Jan 20, 2012 15:44
This thread is locked and should be used for reference only. Please use the Legacy add-ons forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.