public static void Main()
var database = new Database();
var dbType = database.GetType();
var getChangesMethod = dbType.GetMethod("GetChanges");
foreach(var type in dbType.GetProperties().Select(p => p.PropertyType).Where(t => t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Set<>)).Select(t => t.GenericTypeArguments.First()))
var concrateGetChangesMethod = getChangesMethod.MakeGenericMethod(type);
concrateGetChangesMethod.Invoke(database, null);
public Set<Alarm> Alarms { get; set; }
public Set<Area> Areas { get; set; }
public int Other { get; set; }
public void GetChanges<T>()
Console.WriteLine("GetChanges for type: " + typeof(T).Name);