Skip to content

Instantly share code, notes, and snippets.

@felipebaltazar
Created March 2, 2021 00:56
Show Gist options
  • Save felipebaltazar/19ed80de993361bcf80d94e539837916 to your computer and use it in GitHub Desktop.
Save felipebaltazar/19ed80de993361bcf80d94e539837916 to your computer and use it in GitHub Desktop.
namespace Notifications
{
public partial class MyStartup : ShinyStartup
{
public static IContainer? Container { get; private set; }
public override void ConfigureServices(IServiceCollection services, IPlatform platform)
{
services.UseFirebaseMessaging<PushDelegate>();
}
public override IServiceProvider CreateServiceProvider(IServiceCollection services)
{
var container = new Container(Rules
.Default
.WithConcreteTypeDynamicRegistrations(reuse: Reuse.Transient)
.With(Made.Of(FactoryMethod.ConstructorWithResolvableArguments))
.WithFuncAndLazyWithoutRegistration()
.WithTrackingDisposableTransients()
.WithoutFastExpressionCompiler()
.WithFactorySelector(Rules.SelectLastRegisteredFactory())
);
DryIocAdapter.Populate(container, services);
Container = container;
return container.GetServiceProvider();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment