/* * RollSet.cs * * Author(s): * Bengt Thuree * Stephane Delcroix * * This is frees software. See COPYING for details. */ namespace FSpot { public class RollSet : IQueryCondition { private Roll [] rolls; public RollSet (Roll [] rolls) { this.rolls = rolls; } public RollSet (Roll roll) : this (new Roll[] {roll}) { } public string SqlClause () { //Building something like " photos.roll_id IN (3, 4, 7) " System.Text.StringBuilder sb = new System.Text.StringBuilder (" photos.roll_id IN ("); for (int i = 0; i < rolls.Length; i++) { sb.Append (rolls [i].Id); if (i != rolls.Length - 1) sb.Append (", "); } sb.Append (") "); System.Console.WriteLine (sb.ToString ()); return sb.ToString (); } } }