开发者

Using Where With SubSonic Collection

开发者 https://www.devze.com 2022-12-13 08:17 出处:网络
I am having problem with collection object. Here is the code CarCollection obj=new CarCollection(); obj.Where(\"Id\",\"10\");

I am having problem with collection object. Here is the code

CarCollection obj=new CarCollection(); obj.Where("Id","10"); obj.Load();

The problem is the result of the records doubles i.e actually there is only 1 record with the id 10 but it returns 2 same records. Please He开发者_StackOverflowlp me as i am a newbie.

Thanks


You should be able to do this with the following query:

CardCollection cards = new Select()
  .From(Card.Schema)
  .Where(Card.IdColumn).IsEqualTo(10)
  .ExecuteAsCollection<CardCollection>();

I'd suggest you have a look at the query docs to see some examples of SubSonic queries:

http://subsonicproject.com/docs/Simple_Query_Tool

0

精彩评论

暂无评论...
验证码 换一张
取 消