Ejemplo n.º 1
0
        private static IEnumerable <Notifiable> GetModels(Notifiable aggregate)
        {
            GuardAgainst.Null(aggregate, nameof(aggregate));

            var models = aggregate
                         .GetType()
                         .GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly)
                         .Where(p => typeof(Notifiable).IsAssignableFrom(p.PropertyType))
                         .Select(p => (Notifiable)p.GetValue(aggregate))
                         .ToList();

            models.Insert(0, aggregate);

            return(models);
        }