Exemplo n.º 1
0
        public void AddRow(DynamicTableEntity result)
        {
            Dictionary <string, object> values = new Dictionary <string, object>();

            foreach (var column in _dbTableSchema.Columns)
            {
                values.Add(column.ColumnName, null);
            }

            foreach (var property in result.Properties)
            {
                try
                {
                    values[property.Key] = property.Value.PropertyAsObject;
                }
                catch (Exception e)
                {
                    Console.WriteLine("Schema broken.");
                }
            }

            var row = ActiveRecord.Create(_dbTableSchema, values);

            Rows.Add(row);
        }