Exemplo n.º 1
0
        public static object[] Map(MappingConfig config, Type[] types, ColumnValueSet columns)
        {
            int offset = 0;
            var ret    = new object[types.Length];

            for (int i = 0; i < types.Length; ++i)
            {
                if (config.ScalarTypes.Contains(types[i]))
                {
                    ret[i]  = MapScalar(config, types[i], columns.GetRange(offset, 1));
                    offset += 1;
                }
                else
                {
                    var table = Table.Get(types[i]);
                    ret[i]  = MapModel(config, table, columns.GetRange(offset, table.PhysicalColumns.Length));
                    offset += table.PhysicalColumns.Length;
                }
            }
            if (offset != columns.Count)
            {
                throw PtixedException.InvalidMapping();
            }
            return(ret);
        }