A common pattern in ASP.NET Core is to have well known types or interfaces such as IComponent, Controller or Hub, that a user derives from and the framework reflects over. For e.g.
void SetProperties(IComponent component, IDictionary<string, object> values)
{
var properties = component.GetType().GetProperties(...);
SetValues(properties, values);
}
InvokeController(Controller controller, string method)
{
controller.GetMethod(method).Invoke();
}
In the component case, having the ability to have type level trimming would help - if the type is referenced, always preserve it's members. In the event of a Controller or a Hub, we want the ability to say always preserve any types that derive from these types since they're primarily discovered and accessed via reflection.