public Guid Add(Dictionary<string, string> fields, Guid rowId) { // for simplicity this index serializes the field values into one column. // unfortunately this means we can't sort by field value when getting the // form entries, but we'll just have to live with that. var row = new Entry { ContentId = _contentId, CreatedDate = DateTime.Now, FieldValues = JsonConvert.SerializeObject(fields), EntryId = rowId }; Database.Insert(row); return row.EntryId; }
private static StorageRow ToFormRow(Entry entry) { var fields = JsonConvert.DeserializeObject<Dictionary<string, string>>(entry.FieldValues); return new StorageRow(entry.EntryId, entry.CreatedDate, fields); }