Answered by:
How to add parameters to MetaTable.GetQuery() ,please?

Question
-
User745141034 posted
How to add parameters to MetaTable.GetQuery() ,please?
like this:
var query=Column.Table.GetQuery(o=>o.FieldName=="fieldValue");
Can I?
Tuesday, September 11, 2012 5:18 AM
Answers
-
User3866881 posted
Hello,
As far as I see,I think you cannot do that because GetQuery doesn't have such a function. If you want to fetch out the certain column by its name,you can try to do reflection to the entity model,and then fetch its public properties as the columnName——
Sample:
var query = EntityModel.GetType().GetProperties().Where(c=>c.Name=="fieldName");
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, September 12, 2012 8:21 PM
All replies
-
User3866881 posted
Hello,
As far as I see,I think you cannot do that because GetQuery doesn't have such a function. If you want to fetch out the certain column by its name,you can try to do reflection to the entity model,and then fetch its public properties as the columnName——
Sample:
var query = EntityModel.GetType().GetProperties().Where(c=>c.Name=="fieldName");
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, September 12, 2012 8:21 PM -
User745141034 posted
Hello:
MetaTable.GetQuery() fetch all data of the table. I hope MetaTable.GetQuery() can fetch partial data of the table through filter condition.
How to do,please?
Thursday, September 13, 2012 8:00 AM -
User3866881 posted
MetaTable.GetQuery()Have you tried something like MetaTable.GetQuery().Where(c=>c.Name="something")?
Thursday, September 13, 2012 8:32 PM -
User745141034 posted
zzdfc
MetaTable.GetQuery()Have you tried something like MetaTable.GetQuery().Where(c=>c.Name="something")?
Hi:
I have tried that,but it don't support clause of "Where(c=>c.Name="something")"
Thursday, September 13, 2012 9:16 PM -
User-1488931086 posted
zzdfcI'm afraid u have to use reflection, u've no ways to do that……
Thursday, September 13, 2012 9:49 PM