public static List <Coupon> GetAll(int storeId) { CouponQuery q = new CouponQuery(); q.Where(q.StoreId == storeId); q.OrderBy(q.Code.Ascending); CouponCollection collection = new CouponCollection(); collection.Load(q); return(collection.ToList()); }