private static JObject BuildEntity(IEnumerable<Lot> lots) { if (lots == null) throw new ArgumentNullException(); var builder = new EntityBuilder("lot") .Properties("size", lots.Count().ToString()); foreach (var lot in lots) { builder.EmbeddedRepresentation("lot", lot.Id.ToString(), new Dictionary<string, string> { {"Id",lot.Id.ToString()}, {"Title",lot.Title}, {"Title",lot.StartTime.ToLongDateString()}, {"EndTime",lot.EndTime.ToLongDateString()}, {"Title",lot.CurrentPrice.ToString()}, }); } return builder.Build(); }
private static JObject BuildEntity(IEnumerable<Bid> bids) { if (bids == null) throw new ArgumentNullException(); var builder = new EntityBuilder("lot") .Properties("size", bids.Count().ToString()); foreach (var bid in bids) { builder.EmbeddedRepresentation("lot", null, new Dictionary<string, string> { {"Id",bid.Amount.ToString()}, {"Title",bid.Timestamp.ToLongDateString()}, {"Title",bid.User.Username} }); } return builder.Build(); }