using System.Collections.Generic;
public static void Main()
var testObject = new TestModel() {PoleOne = "odin"};
var nullProps = GetNullPropertyNames(testObject);
foreach(var nullProp in nullProps)
Console.WriteLine(nullProp);
public static IReadOnlyCollection<string> GetNullPropertyNames<T>(T target)
var nullProperties = new List<string>();
var properties = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance);
foreach (var propertyInfo in properties)
var propertyValue = propertyInfo.GetValue(target);
var readableNameAttribute = propertyInfo.GetCustomAttribute<HumanReadableNameAttribute>();
if (propertyValue == null)
nullProperties.Add(readableNameAttribute?.Name ?? propertyInfo.Name);
[HumanReadableName("pole odin")]
public string PoleOne { get; set; }
[HumanReadableName("readable prop 2")]
public string PoleDva { get; set; }
[HumanReadableName("readable prop 3")]
public string PoleTri { get; set; }
[AttributeUsage(AttributeTargets.Property)]
public class HumanReadableNameAttribute : Attribute {
public string Name { get; private set; }
public HumanReadableNameAttribute(string name){