Exemplo n.º 1
0
        private void ReplaceNames(DataSourceRequest request)
        {
            var props = typeof(T).GetProperties(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public)
                        .Select(p => new { p.Name, DataAttribute = p.GetCustomAttribute <DataColumnAttribute>() })
                        .Where(p => p.DataAttribute != null && !string.IsNullOrEmpty(p.DataAttribute.MappedFromColumn))
                        .ToDictionary(p => p.Name, p => p.DataAttribute.MappedFromColumn);

            request.ReplaceNames(props);
        }