Description
Looking into what it means to takes to make ASP.NET Core more linkable once we get this (#40227) and (dotnet/aspnetcore#24458), options is the next big hurdle to cross. The issue is the very similar to DI in that the option system creates instances but the linker doesn't understand that and removes constructors from the poco objects.
public class MyOptions
{
public int Value { get; set; };
}
var services = new ServiceCollection();
services.AddOptions();
services.Configure<MyOptions>(o =>
{
o.Value = 100;
});
var service= services.GetService<IOptions<MyOptions>>();
var value = service.Value;
Linking this should preserve MyOptions constructors.
This matters for:
IOptions<T>
IOptionsMonitor<T>
IOptionsSnapshot<T>
cc @eerhardt
Description
Looking into what it means to takes to make ASP.NET Core more linkable once we get this (#40227) and (dotnet/aspnetcore#24458), options is the next big hurdle to cross. The issue is the very similar to DI in that the option system creates instances but the linker doesn't understand that and removes constructors from the poco objects.
Linking this should preserve
MyOptionsconstructors.This matters for:
IOptions<T>IOptionsMonitor<T>IOptionsSnapshot<T>cc @eerhardt