Last active
August 29, 2015 14:05
-
-
Save nekitozzz/e2417a9e070ed3020f38 to your computer and use it in GitHub Desktop.
Iterate by properties C# using reflection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Выбираем все строки, в которых содержатся хоть какие-то данные | |
var nonEmptyItems = | |
items.Where( | |
i => i.GetType() | |
.GetProperties() | |
.Any(p => !string.IsNullOrWhiteSpace(p.GetValue(i) as string))) | |
.ToList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment