Ejemplo n.º 1
0
        private string GetColumnNameWithAs(string source, string key)
        {
            var name   = FluentEntityAdoHelper.ConcatTableColumn(source, key);
            var nameAs = FluentEntityAdoHelper.ConcatTableColumnAs(source, key);

            return($"{name} AS {nameAs}");
        }
Ejemplo n.º 2
0
        private T MapObject(IDataRecord record)
        {
            foreach (var tableName in _tableNames)
            {
                var currentModel = _joinedTableObjects.ContainsKey(tableName) ?
                                   _joinedTableObjects[tableName] :
                                   _referenceModel;

                if (_selectedColumns.ContainsKey(tableName))
                {
                    foreach (var column in _selectedColumns[tableName])
                    {
                        var field = FluentEntityAdoHelper.ConcatTableColumnAs(tableName, column.Attribute.Name);
                        var value = record[field];
                        column.Property.SetValue(currentModel, ConvertDbValue(value, column));
                    }
                }
            }

            return((T)_referenceModel.Clone());
        }